On 8 April 2016 at 00:25, Jim J. Jewett <jimjjew...@gmail.com> wrote: > (1) I think the "built-in" should instead be a module-level function > in the pathlib. If you aren't already expecting pathlib paths, then > you're just expecting strings to work anyhow, and a builtin isn't > likely to be helpful.
Concrete data in relation to "Why not put the helper function in pathlib?": >>> import sys >>> orig_modules = set(sys.modules) >>> "os" in orig_modules True >>> import pathlib >>> extra_dependencies = set(sys.modules) - orig_modules >>> print(sorted(extra_dependencies)) ['_collections', '_functools', '_heapq', '_operator', '_sre', 'collections', 'contextlib', 'copyreg', 'fnmatch', 'functools', 'heapq', 'itertools', 'keyword', 'ntpath', 'operator', 'pathlib', 're', 'reprlib', 'sre_compile', 'sre_constants', 'sre_parse', 'urllib', 'urllib.parse', 'weakref'] We want to be able to readily use the protocol helper in builtin modules like os and low level Python modules like os.path, which means we want it to be much lower down in the import hierarchy than pathlib. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com