Skip to content

Use python 3.14 compatible counter value retrieval in get_current_compiled_fn_name#93

Open
rasmith wants to merge 1 commit into
thuml:masterfrom
rasmith:fix_itertools_count_314
Open

Use python 3.14 compatible counter value retrieval in get_current_compiled_fn_name#93
rasmith wants to merge 1 commit into
thuml:masterfrom
rasmith:fix_itertools_count_314

Conversation

@rasmith

@rasmith rasmith commented Jul 2, 2026

Copy link
Copy Markdown

Using copy(itertools.count()) results in a

TypeError: cannot pickle 'itertools.count' object

error in Python 3.14.

This PR makes it so that this operation is compatible with Python 3.14. The result of the evaluation is the same, even though
it doesn't look as nice.

>>> import itertools
>>> from copy import copy
>>> c = itertools.count()
>>> next(copy(c)) - 1
-1
>>> int(str(c).replace("count(","").replace(")","")) - 1
-1
>>>

Signed-off-by: Randall Smith <Randall.Smith@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant