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?

you are viewing a single comment's thread
view the rest of the comments
[–] 3 points 7 months ago (1 child)

Why not require values in the constructor?

  • source
  • hideshow 1 child comment