[issue33440] Possible lazy import opportunities in `pathlib`

2018-05-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Personally I support moving imports of rarely used modules into functions that need them. But this is against PEP 8 and should be discussed more widely. Perhaps this rule should be weaken, we have to state what exceptions are

[issue33440] Possible lazy import opportunities in `pathlib`

2018-05-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Did you mean the idea about module-level alias to dirname(__file__)? I think this is a dead horse. See issue33277. -- nosy: +serhiy.storchaka ___ Python tracker

[issue33440] Possible lazy import opportunities in `pathlib`

2018-05-14 Thread Adam Forsyth
Change by Adam Forsyth : -- keywords: +patch pull_requests: +6505 stage: -> patch review ___ Python tracker ___

[issue33440] Possible lazy import opportunities in `pathlib`

2018-05-07 Thread Nathaniel Smith
Nathaniel Smith added the comment: Also it's a smaller win, but it might be worth considering whether we can avoid the import of 'nt' on posix platforms and vice-versa. -- ___ Python tracker

[issue33440] Possible lazy import opportunities in `pathlib`

2018-05-07 Thread Nick Coghlan
New submission from Nick Coghlan : Due to a python-ideas discussion about reducing boilerplate for __file__-relative path calculations, I was running "./python -X importtime -S -c 'import pathlib'" and noticed three potential candidates where it may be worthwhile deferring