• Sanyam Khurana's avatar
    bpo-31506: Improve the error message logic for class instantiation (GH-4740) · 780acc89
    Sanyam Khurana authored
    The error messages in `object.__new__` and `object.__init__` now aim
    to point the user more directly at the name of the class being instantiated
    in cases where they *haven't* been overridden (on the assumption that
    the actual problem is a missing `__new__` or `__init__` definition in the
    class body).
    
    When they *have* been overridden, the errors still report themselves as
    coming from object, on the assumption that the problem is with the call
    up to the base class in the method implementation, rather than with the
    way the constructor is being called.
    780acc89
2017-12-07-23-44-29.bpo-31506.j1U2fU.rst 97 Bytes