For example:
class FooBar:
def __init__(self):
self.a: int = None
self.foo: str = None
Is this bad practice/go against PEP guidelines or is it fine?
For example:
class FooBar:
def __init__(self):
self.a: int = None
self.foo: str = None
Is this bad practice/go against PEP guidelines or is it fine?
While we are on da topic, always use string notation! My experience, this was really non-obvious.
With both cast and typing. With cast, can let builtin types, like str or int, be passed in without the string notation.
This reduces the typing imports bleeding into your runtime code modules and tests.