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

2018-06-06 Thread Barry Scott
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 Pat

Re: [Python-ideas] Runtime assertion with no overhead when not active

2018-06-06 Thread Eloi Gaudry
The check is made against a boolean value in the C extension, I don't think that it offers a significant speed-up against the pure python code. but it offers a simpler (reduced, global) assertion syntax though. From: Python-ideas on behalf of Kyle Lahnakoski S

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

2018-06-06 Thread Chris Barker - NOAA Federal via Python-ideas
>>> For the startup time, you could keep it around as builtin but save the >>> import time until someone actually uses it. >> >> That would mean creating a system of lazy imports, which is an >> entirely separate proposal. > > It's that complicated ? I know it's not exactly properties on a class, >

Re: [Python-ideas] Add hooks to asyncio lifecycle

2018-06-06 Thread Andrew Svetlov
Hold on. aiohttp doesn't suffer from hooks absence. Moreover, I don't see how these hooks could be utilized by aiohttp. Gunicorn workers are not imported and instantiated by user code, they are imported by gunicorn using a command line parameter. Please choose a different use case as the proof of

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

2018-06-06 Thread Jacco van Dorp
2018-06-06 14:51 GMT+02:00 Chris Angelico : > On Wed, Jun 6, 2018 at 7:51 PM, Jacco van Dorp wrote: >> For the startup time, you could keep it around as builtin but save the >> import time until someone actually uses it. > > That would mean creating a system of lazy imports, which is an > entirely

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

2018-06-06 Thread Chris Angelico
On Wed, Jun 6, 2018 at 7:51 PM, Jacco van Dorp wrote: > For the startup time, you could keep it around as builtin but save the > import time until someone actually uses it. That would mean creating a system of lazy imports, which is an entirely separate proposal. ChrisA _

Re: [Python-ideas] Add hooks to asyncio lifecycle

2018-06-06 Thread Michel Desmoulin
Hi Yuri, > > I actually want to propose to reduce policies API surface by > deprecating and then removing "set_child_watcher()" methods. Besides, > there are many other higher priority To-Do items for asyncio in 3.8, > like implementing Trio's nursery-like objects and cancellation scopes > or

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

2018-06-06 Thread Jacco van Dorp
For the startup time, you could keep it around as builtin but save the import time until someone actually uses it. While I agree sqrt should be a builtin as well, I think there's a good argument to be made for Path to. I just switched to it the past month, and im liking it a lot over constructs li

Re: [Python-ideas] Add dict.append and dict.extend

2018-06-06 Thread Chris Angelico
On Wed, Jun 6, 2018 at 4:18 PM, Chris Barker via Python-ideas wrote: > > Also -- seems kind of odd to raise a KeyError when the key IS there?!? class DuplicateKeyError(LookupError): pass Problem solved :) ChrisA ___ Python-ideas mailing list Python-id