As of Python 3.13, itertools.tee() now "flattens" other tee objects, as documented in #123885.
This behavior change seems to be from Python 3.13 because tee() objects in Python 3.12 and below do not seem to flatten.
It seems like this behavior should have a "Changed in version 3.13" call out in the documentation for `itertools.tee.
A student just ran across this change in behavior and found it confusing. I did some experimenting on different Python versions and some research and eventually discovered this new flattening behavior. A call-out in the documentation might have saved us some time.
Linked PRs
As of Python 3.13,
itertools.tee()now "flattens" otherteeobjects, as documented in #123885.This behavior change seems to be from Python 3.13 because
tee()objects in Python 3.12 and below do not seem to flatten.It seems like this behavior should have a "Changed in version 3.13" call out in the documentation for `itertools.tee.
A student just ran across this change in behavior and found it confusing. I did some experimenting on different Python versions and some research and eventually discovered this new flattening behavior. A call-out in the documentation might have saved us some time.
Linked PRs