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
[–] 2 points 7 months ago (1 child)

foo[0] is also unsafe unless foo is known to be nonempty, ofc.

  • source
  • parent
  • hideshow 1 child comment