4 ms·
Good list. Some of these i knew already, but the typing overloading and keyword/positional-only arguments were new to me. One personal favorite of mine is __al
by mvATM99 1y ago
Good list. Some of these i knew already, but the typing overloading and keyword/positional-only arguments were new to me.
One personal favorite of mine is __all__ for use in __init__.py files. It specifies which items are imported whenever uses from x import *. Especially useful when you have other people working on your codebase with the tendency to always import everything, which is rarely a good idea.
- hk__2 1y agoIt’s never a good idea. I use `__all__` to explicitely list my exports in libraries, so that when one write `from mylib import `, the IDE auto-completes only the public classes and functions.