2 ms·
Your code is comparing to the wrong alternative; the comparison should be to connection = connect_to_database() my_var = MyType(connection) It's far m
by mjr00 2y ago
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.