Skip to content

Improve UX by using fully-qualified name in some TypeError #138978

@smurfix

Description

@smurfix

Feature or enhancement

Proposal:

The error message TypeError: Can't instantiate abstract class FOO without an implementation for abstract methods 'BAR' doesn't tell me with module FOO comes from.

This is unfortunate, particularly in larger code bases where several FOO-ish classes live in distinct modules but have the same local name: discovering which class triggered the problem may require nontrivial code analysis.

Thus I propose to extend this error message so that it reports the module name, i.e. abstract class BAZ.BAR.FOO, instead.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions