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

Michel Desmoulin desmoulinmichel at gmail.com
Sat Jun 9 04:58:00 EDT 2018


Creating built in dynamically is not a good idea. Tools complain, new
comers wonder where it comes from, it sets a precedent for adding more
or debating about it.

Better have the debate once here, make it official or decline it
officially, and have a clean result.

Le 08/06/2018 à 21:28, Barry a écrit :
> I think you forgot to to reply to the list.
> Barry
> 
> 
>> On 8 Jun 2018, at 13:16, Michel Desmoulin <desmoulinmichel at gmail.com> wrote:
>>
>> Creating builtin dynamically is not a good idea. tools complains, new comers wonder where it comes from, it sets a precedent for adding more or debating about it.
>>
>> Better have the debate once here, make it official or decline it officially, and have a clean result.
>>
>>> Le 06/06/2018 à 20:05, Barry Scott a écrit :
>>> 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
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Python-ideas mailing list
>>> Python-ideas at python.org
>>> https://mail.python.org/mailman/listinfo/python-ideas
>>> Code of Conduct: http://python.org/psf/codeofconduct/
>>>
>>
> 


More information about the Python-ideas mailing list