Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-2116

Add __repr__ to monitoring event classes

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.11
    • None
    • None

    Description

      It would be nice to add human readable __repr__ to our monitoring event classes. This change would make it much easier to debug tests since we could immediately see a readable description instead of:

      <pymongo.monitoring.ServerDescriptionChangedEvent object at 0x104f2d300>
      

      Something like:

      <pymongo.monitoring.ServerDescriptionChangedEvent localhost:27017 changed type from RSPrimary to Unknown>
      

      Attachments

        Issue Links

          Activity

            People

              shane.harvey@mongodb.com Shane Harvey
              shane.harvey@mongodb.com Shane Harvey
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: