Uploaded image for project: 'Motor'
  1. Motor
  2. MOTOR-109

Update MotorCursor for Python 3.5.2 async iterator

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.0
    • Affects Version/s: None
    • Component/s: None
    • None

      Python 3.5.2 will ship an update to the async iter protocol:

      In CPython 3.5.2, the __aiter__ protocol was updated.
      
      Before 3.5.2, __aiter__ was expected to return an awaitable resolving to an asynchronous iterator . Starting with 3.5.2, __aiter__ should return asynchronous iterators directly.
      
      If the old protocol is used in 3.5.2, Python will raise a PendingDeprecationWarning .
      
      In CPython 3.6, the old __aiter__ protocol will still be supported with a DeprecationWarning being raised.
      
      In CPython 3.7, the old __aiter__ protocol will no longer be supported: a RuntimeError will be raised if __aiter__ returns anything but an asynchronous iterator.
      

      MotorCursor probably needs updating. We may need conditional compilation for Python 3.5.0 and 3.5.1.

      https://www.python.org/dev/peps/pep-0492/#api-design-and-implementation-revisions

      http://bugs.python.org/issue27243

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: