Skip to content

[FEATURE] Provide a "official" string representation for most classes #3770

@harshil21

Description

@harshil21

What kind of feature are you missing? Where do you notice a shortcoming of PTB?

We should define a __repr__ for most telegram classes, since it is useful for debugging/inspection purposes.

Describe the solution you'd like

Define a __repr__ in all base classes. Typically, the representation should be of the form <...some useful description...>. We can just have it so that it returns the expression which can be used to recreate the object.

Describe alternatives you've considered

No response

Additional context

First suggested in #3759 (comment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions