May-06-2021, 01:40 PM
In Python it is common style "easier to ask for forgiveness than permission" EAFP.
So pythonic way is to try to get value and handle AttributeError exception.
Regarding None - it has no attributes so no len, no characters etc. Is .isdigit() documentation clear regarding this behaviour? Maybe yes, maybe not.
Quote from Christian Heimes (CPython core developer) about bugs, not ambiguity in documentation, but still relevant in my mind:
So pythonic way is to try to get value and handle AttributeError exception.
Regarding None - it has no attributes so no len, no characters etc. Is .isdigit() documentation clear regarding this behaviour? Maybe yes, maybe not.
Quote from Christian Heimes (CPython core developer) about bugs, not ambiguity in documentation, but still relevant in my mind:
Quote:On the one hand you have a project with around 7,500 open bugs, 1,500 open PRs, and new 50 new bugs every week. On the other hand there are a couple of dozen volunteers who spend some of their free time on the same project. The amount of open tickets and PRs is constantly increasing.
The solution obvious is: All it takes is a sufficiently large team so the team can handle all incoming tasks and reduce the backlog slowly.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.