2 ms·
The ? attribute would indeed be a welcome addition, but not to work in the same way as in JS. In JS, it ignore null values. That wouldn't work in python. We wo
by BiteCode_dev 4y ago
The ? attribute would indeed be a welcome addition, but not to work in the same way as in JS. In JS, it ignore null values. That wouldn't work in python.
We would need a ? to says "ignore AttributeError, IndexError and KeyError on that access".
However, the use of {} for set is not a problem.
First, remember than Python is much, much older than JS. Insight is 20/20. Second, you could always use a different syntax.