Skip to content

Commit

Permalink
docs: remove line about Python 2.7 being unsupported (#808)
Browse files Browse the repository at this point in the history
* docs: remove line about Python 2.7 being unsupported

According to the README and setup.py, we do support Python 2.7.

Also clarify that the utils module and its positional decorator
do still exist and does work in both Py2 and Py3

* Update migrating.rst
  • Loading branch information
rwhogg authored Nov 2, 2022
1 parent 1f46121 commit 06dea1b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions docs/migrating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,22 +174,21 @@ a number of methods that were mostly used internally. Some of those have been
made obsolete by new Python 3 features, while others have been discarded due
to implementation differences in the new `ndb`.

Possibly the most used utility from this module outside of `ndb` code, is the
Possibly the most used utility from this module outside of `ndb` code is the
``positional`` decorator, which declares that only the first `n` arguments of
a function or method may be positional. Python 3 can do this using keyword-only
arguments. What used to be written as::

@utils.positional(2)
def function1(arg1, arg2, arg3=None, arg4=None)
def function1(arg1, arg2, arg3=None, arg4=None):
pass

Will be written like this in the new version::
Should be written like this in Python 3::

def function1(arg1, arg2, *, arg3=None, arg4=None)
def function1(arg1, arg2, *, arg3=None, arg4=None):
pass

Note that this could change if Python 2.7 support is added at some point, which
is still a possibility.
However, ``positional`` remains available and works in both Python 2 and 3.

Exceptions
==========
Expand Down

0 comments on commit 06dea1b

Please sign in to comment.