3 ms·
I like that the author starts with a use-case and then solves it by using the class that the article sets out to introduce. I do feel like the article lacks de
by wodenokoto 5y ago
I like that the author starts with a use-case and then solves it by using the class that the article sets out to introduce.
I do feel like the article lacks depth in describing what a chainmap actually is, how I can be sure which key takes precedence and lastly, I am not quite sure if I am convinced if the method for sanity checking values scales very well.
- angrais 5y agoAlso to add: do people still use "isinstance" for comparing types? Always has help like an antipattern to me.
- anitil 5y agoHow so? Do you mean because it is implicit in it's information rather than explicit? I've been using it a bit for tree structures where an element could be a tree or a leaf, so isintance(node, tuple) is just the ticket. Seems simpler than creating a Node class, and can easily be dumped to json where I need
- dec0dedab0de 5y agoI do, if you do something like type(x) == SomeClass then you won't catch any subclasses of SomeClass