Skip to content

Python 3.11 produces an error when using the __repr__ method on Events #2997

@lewisoptellum

Description

@lewisoptellum

🐛 Bug description

When using the __repr__ method using py3.11 an event produces AttributeError: 'str' object has no attribute 'name' . This doesn't happen using py3.8. Perhaps related to #2904

This can be reproduced:

 completed = ignite.engine.Events.COMPLETED
 print(completed) #works
 print(f"{completed!r}") #doesn't work 

Environment

  • PyTorch Version (e.g., 1.4): 2.0.1
  • Ignite Version (e.g., 0.3.0): 0.4.12
  • OS (e.g., Linux): Ubuntu 22.04.2 LTS
  • How you installed Ignite (conda, pip, source): pip
  • Python version: 3.11.3
### Tasks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions