News for hackers. Stuff that matters.
Re:Frankenstein's `__init__` by mjr00 on Saturday April 19, 2025 @07:34PM (#43740309)
Your code is comparing to the wrong alternative; the comparison should be to

    connection = connect_to_database()
    my_var = MyType(connection)
It's far more testable, maintainable, more explicit about when and which objects are created, and never has a partially initialized object.

There are no comments on this comment yet.