bson/son.py contains 3 methods added for Python 2 compatibility that are no longer needed

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Unknown
    • 4.17.0
    • Affects Version/s: None
    • Component/s: BSON, Python Support
    • None
    • Python Drivers
    • Completed
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      bson/son.py contains three methods that were added for Python 2 compatibility but are no longer needed:

      • has_key(key) — Python 2's dict.has_key(), replaced by key in son
      • iterkeys() — Python 2's dict.iterkeys(), replaced by iter(son)
      • itervalues() — Python 2's dict.itervalues(), replaced by iter(son.values())

      Definition of done

      Since SON is a public class with documented API, these should be deprecated before removal:

      1. Add warnings.warn(..., DeprecationWarning, stacklevel=2) to each method
      2. In a later release, remove the methods and their test coverage in test/test_son.py

      Pitfalls

      N/A

            Assignee:
            Alex Clark
            Reporter:
            Alex Clark
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: