4 ms·
Feels like a good feature, with a simple explanation, real world use cases, and a scoped solution (global only, pretty simple keyword). I like it!
by TheMrZZ 1y ago
Feels like a good feature, with a simple explanation, real world use cases, and a scoped solution (global only, pretty simple keyword). I like it!
- 12_throw_away 1y agoYeah, I think this is one of the cleanest PEPs to come around in quite a while, at least from the userspace perspective. Interested to see what happens after the traditional syntax bikeshedding ritual has been completed.
- oofbey 1y agoHopefully they learned lessons from why PEP-690 was rejected. I've spent quite a while trying to build this stuff for our codebase and it's never worked well enough to use.
- dahart 1y ago690 is mentioned a few times, including a FAQ note on the differences https://pep-previews--4622.org.readthedocs.build/pep-0810/#faq https://pep-previews--4622.org.readthedocs.build/pep-0810/#f... Q: How does this differ from the rejected PEP 690? A: PEP 810 takes an explicit, opt-in approach instead of PEP 690’s implicit global approach. The key differences are: Explicit syntax: lazy import foo clearly marks which imports are lazy. Local scope: Laziness only affects the specific import statement, not cascading to dependencies. Simpler implementation: Uses proxy objects instead of modifying core dictionary behavior.
- BiteCode_dev 1y agoAgree, they really did their homework, listed edge cases, made practical compromises, chose not to overdo it, reworked it again and again quite a bit and compared it to real life experience. It's really beautiful work, especially since touching the back bone (the import system) of a language as popular as Python with such a diverse community is super dangerous surgery. I'm impressed.