(no title)
wdroz | 2 months ago
...
print(container.area)
> AttributeError: 'Container' object has no attribute 'area'. Did you mean: 'inner.area'?[0] -- https://docs.python.org/3.15/whatsnew/3.15.html#improved-err...
wdroz | 2 months ago
...
print(container.area)
> AttributeError: 'Container' object has no attribute 'area'. Did you mean: 'inner.area'?[0] -- https://docs.python.org/3.15/whatsnew/3.15.html#improved-err...
edflsafoiewq|2 months ago
Search is limited to 20 attributes and non-descriptors only to avoid arbitrary code execution.
I assume constructing AttributeErrors isn't highly performance sensitive.
dotancohen|2 months ago
mort96|2 months ago
In Python, the VM raises a KeyboardInterrupt exception when the user hits ctrl+c in order to unwind the stack, run cleanup code and eventually exit the program.
Python is a quite heavy user of exceptions for control flow.
Hendrikto|2 months ago
I really dislike this too, but that’s how it is.
IshKebab|2 months ago
On the other hand it's not like Python really cares about performance....
formerly_proven|2 months ago
[heavy green check mark]
[red x] The latter form also has the genuine disadvantage that nothing ensures the two keys are the same. I've seen typos there somewhat often in code reviews.amluto|2 months ago