EXPERIONCED PYTHON
There is always a way to make your code more meaningful, even when using functions, SDK and libraries you don't own.
NamedTuple is one of many tools that allows you to make your code charged with semantics and types annotations. Remember, no one can guess what something[0] is, but everyone KNOWS what 'something .id' is.
Have a good day,
Dorian
PS: Want to know more about NamedTuple?
- Stackoverflow: https://lnkd.in/eADHiJai
- collections doc: https://lnkd.in/ehNaWt3A
- typing doc: https://lnkd.in/eUrs2Bc5
What is a "What's new": https://lnkd.in/e77S2WKq
___
📣 This post was made with accessibility in mind:
- Image with an alt-text: https://lnkd.in/ebxb_QUc
- No special characters: https://lnkd.in/gTmqA-BH
Python is about accessibility, be accessible in your posts makes you a better Pythonista 🐍 !
No comments