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

Add __repr__ to monitoring event classes

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.11
    • Component/s: None
    • Labels:
      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

              Assignee:
              shane.harvey Shane Harvey
              Reporter:
              shane.harvey Shane Harvey
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: