[Python-ideas] Making Path() a built in.

Barry Scott barry at barrys-emacs.org
Wed Jun 6 14:05:35 EDT 2018


I assume the the idea is that everybody has Path available without the need to do the import dance first.

If its for personal convenience you can always do this trick, that is used by gettext to make _ a builtin.

import pathlib
import builtings

builtins.__dict__['Path'] = pathlib.Path

Now Path *is* a builtin for the rest of the code.

Barry






More information about the Python-ideas mailing list