Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove sys.version_info bridges in client.dynamic #435

Closed
junkmd opened this issue Dec 31, 2022 · 1 comment · Fixed by #436
Closed

remove sys.version_info bridges in client.dynamic #435

junkmd opened this issue Dec 31, 2022 · 1 comment · Fixed by #436
Assignees
Labels
drop_py2 dev based on supporting only Python3, see #392 good first issue Good for newcomers

Comments

@junkmd
Copy link
Collaborator

junkmd commented Dec 31, 2022

THIS IS FOR drop_py2 PLAN! Please see #392.

In Python3,

PEP 3114: the standard next() method has been renamed to __next__().
https://docs.python.org/3/whatsnew/3.0.html#operators-and-special-methods

However, they are still contained in client.dynamic.

if sys.version_info >= (3, 0):
def __next__(self):
item, fetched = self.enum.Next(1)
if fetched:
return item
raise StopIteration
else:
def next(self):
item, fetched = self.enum.Next(1)
if fetched:
return item
raise StopIteration

Remove this dead code and modernize the codebase.

@junkmd junkmd added good first issue Good for newcomers drop_py2 dev based on supporting only Python3, see #392 labels Dec 31, 2022
@junkmd junkmd self-assigned this Dec 31, 2022
@junkmd
Copy link
Collaborator Author

junkmd commented Dec 31, 2022

I created this issue to serve as a "model case" for future good first issue that I will submit.

I will work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
drop_py2 dev based on supporting only Python3, see #392 good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant