[Python-Dev] Re: PEP 505 (None-aware operators) for Python 3.11

2022-09-21 Thread Philipp Burch
Hi Steven! On 21.09.22 13:17, Steven D'Aprano wrote: The distinction you make between user-defined and non-user-defined classes doesn't hold water. If you allow that (say) `int|None` **might** be acceptable, then why would `Integer|None` **necessarily** be lazy and bad just because int is writte

[Python-Dev] Re: Annotating pure functions to improve inline caching/optimization

2022-09-19 Thread Philipp Burch
Hi Ken, thank you for the inputs. Just one more comment: I actually find myself often factoring such data out of loops in Python, whereas in C I would just leave that to the optimizer/compiler. The compiler in CPython can't really do that because it's not safe in Python. The user could've

[Python-Dev] Re: PEP 505 (None-aware operators) for Python 3.11

2022-09-19 Thread Philipp Burch
Hi all, I've only here found out that there is a discussion going on about those none-aware operators and my first thought was "great, finally!". FWIW, I'd be happy with the syntax suggestion in the PEP, since '?' looks rather intuitive to me to mean something like "maybe". However, I then r

[Python-Dev] Re: Annotating pure functions to improve inline caching/optimization

2022-09-19 Thread Philipp Burch
On 15.09.22 00:05, Jeremiah Gabriel Pascual wrote: I've frequently explored the new adaptive, inline caching code generated by 3.11. "inline caching" does not mean result caching (like what C/C++ might do) here, but rather it should mean the caching of info used for the adaptive instructions. T

[Python-Dev] Annotating pure functions to improve inline caching/optimization

2022-09-14 Thread Philipp Burch
Hello everyone, the docs on the upcoming 3.11 release state > This [specializing adaptive interpreter] also brings in another concept called inline caching, where Python caches the results of expensive operations directly in the bytecode. I wonder how this caching works, given that the dynam