Open
Conversation
ltratt
reviewed
Mar 18, 2026
ltratt
reviewed
Mar 18, 2026
ltratt
reviewed
Mar 18, 2026
ltratt
reviewed
Mar 18, 2026
ltratt
reviewed
Mar 18, 2026
ltratt
reviewed
Mar 18, 2026
added 2 commits
March 18, 2026 17:23
fix some design issues.
Collaborator
Author
|
@ltratt Thanks for pointing out, I have resolved the above suggestions and questions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds 5 new Python 2 -> Python 3 compatibility warnings on the pygrate2 side.
iterator.next() warning
Added a warning in wrap_next() for iterator-style .next() calls. In Python 2, iterators commonly use it.next(), while the supported form in python3 is next(it)
intern() warning
Added a warning in builtin_intern() for builtin intern() calls. In Python 2, intern() is a builtin, while in Python 3 the supported form is sys.intern().
range() materialization warning
Added a warning in builtin_range() for range() results used in list-like contexts that may require materialization. In Python 2, range() returns a list, while in Python 3 it returns a lazy range object, so code such as range(5) + [5] may need to become list(range(5)) + [5].
xrange() materialization warning
Refined the warning in range_new() for xrange() calls to distinguish plain iteration from list-like use. In Python 2, xrange() exists as a lazy iterator-like object, while in Python 3 it is removed and range() is the replacement; in some non-iteration contexts, the result may additionally need list materialization.
dict list-like consumer warning
Added warnings in dict_keys(), dict_values(), and dict_items() when d.keys(), d.values(), or d.items() are used in list-like contexts. In Python 2, these APIs return lists, while in Python 3 they return view objects, so operations such as indexing or list concatenation may require wrapping them with list(...).
Also add corresponding test in the test_py3kwarn.py