3 ms·
> did you know __init__.py is optional nowadays? It's not optional. Omitting it gets you a namespace package, which is probably not what you want. > TypeVar s
by globular-toast 2y ago
> did you know __init__.py is optional nowadays?
It's not optional. Omitting it gets you a namespace package, which is probably not what you want.
> TypeVar supports binding to enforce subtypes: "TypeVar['T', bound=X]",
Using the new generics syntax you mentioned above you can now do:
def method[T: X](...)
- lyu07282 2y agogood points! do you have any more things along those lines you think people might not know about?