Re: [Python-Dev] [Python-checkins] cpython: Issue #14043: Speed up importlib's _FileFinder by at least 8x, and add a new
On Mon, Feb 20, 2012 at 10:55 AM, antoine.pitrou <python-checkins@python.org> wrote:
+def _relax_case(): + """True if filenames must be checked case-insensitively.""" + if any(map(sys.platform.startswith, CASE_INSENSITIVE_PLATFORMS)): + def _relax_case(): + return b'PYTHONCASEOK' in _os.environ else: - return True
Wow, that's horrendously confusing. Please change the name of the factory function to "_make_relax_case" (or something, anything that isn't "_relax_case" would be an improvement). Also, the docstring should be on the created functions, not the factory function. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
However, "very cool" on adding the caching in the default importers :) Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
On Sun, Feb 19, 2012 at 22:15, Nick Coghlan <ncoghlan@gmail.com> wrote:
However, "very cool" on adding the caching in the default importers :)
Thanks to PJE for bringing the idea up again and Antoine discovering the approach *independently* from PJE and myself and actually writing the code. Now I *really* need to get that C hybrid for __import__() finished (in the middle of implementing _gcd_import() in C) to see where the performance ends up.
On Mon, Feb 20, 2012 at 1:20 PM, Brett Cannon <brett@python.org> wrote:
On Sun, Feb 19, 2012 at 22:15, Nick Coghlan <ncoghlan@gmail.com> wrote:
However, "very cool" on adding the caching in the default importers :)
Thanks to PJE for bringing the idea up again and Antoine discovering the approach *independently* from PJE and myself and actually writing the code.
Where is the code, btw? (I looked at your sandbox and didn't see it.)
On Mon, Feb 20, 2012 at 17:29, PJ Eby <pje@telecommunity.com> wrote:
On Mon, Feb 20, 2012 at 1:20 PM, Brett Cannon <brett@python.org> wrote:
On Sun, Feb 19, 2012 at 22:15, Nick Coghlan <ncoghlan@gmail.com> wrote:
However, "very cool" on adding the caching in the default importers :)
Thanks to PJE for bringing the idea up again and Antoine discovering the approach *independently* from PJE and myself and actually writing the code.
Where is the code, btw? (I looked at your sandbox and didn't see it.)
It's not in the sandbox until I do a merge; Antoine committed the code to default so it's already in Python 3.3.
participants (3)
-
Brett Cannon -
Nick Coghlan -
PJ Eby