5 ms·
Classes are callable.
by ojii 1y ago
Classes are callable.
- Spivak 1y agoYou can abuse this fact with type hunting to get a ParamSpec of a class's __init__ arguments. But yeah type systems get weird at the margins. Your class is an instance of type which has a __call__ method which creates an instance of your class.