Pythonic
Written in the natural style of Python, using its built-in features and conventions rather than patterns carried over from other languages.
In more detail
Looping directly over items instead of over indices, using with for files and giving classes a repr are Pythonic. For your own classes it means supporting len, ==, in and printing as users of built-in types expect.
Related terms
- dunder method — A method whose name starts and ends with two underscores, such as __init__ or __len__, which Python calls for you to implement built-in behaviour.
- PEP 8 — The official style guide for Python code, covering layout, naming and common idioms.
Taught in
- Any Type As A Condition — Hands-on Python: Complete Video Course & Book
- Dunder Methods, And Making Objects Pythonic — Hands-on Python: Complete Video Course & Book