4 ms·
The scandir update also changes the underlying implementation of os.walk giving loads of production apps a huge speed increase by making use of additional data
by baxter001 11y ago
The scandir update also changes the underlying implementation of os.walk giving loads of production apps a huge speed increase by making use of additional data returned by the os calls.
- lamby 11y agoCould os.walk have been changed "under the hood" without a PEP? eg. using — just for example — fast_walk_in_c in _os.so (I understand that adding os.scandir might require a PEP)
- masklinn 11y agoIn theory, but because the change was possibly complex and could be useful if available separately, one of the first thing a core member recommended was to iterate the poc as a genuine package and provide an API to the underlying system (which is now scandir). https://mail.python.org/pipermail/python-ideas/2012-November/017784.html https://mail.python.org/pipermail/python-ideas/2012-November... is the original proposal on -ideas.
- haypo 11y agoNo, a PEP was required because there was a lot of discussion on the API, and also non trivial choices on the implementation (pure C? pure Python? C+Python?). To have an idea of the amount of discussion, read the "Rejected ideas" of the PEP: https://www.python.org/dev/peps/pep-0471/#rejected-ideas https://www.python.org/dev/peps/pep-0471/#rejected-ideas
- lamby 11y agoWhy would changing the underlying workings of os.walk require a PEP?