Skip to content

Note change in behavior for itertools.tee() with "flattening" itertablesย #137597

@treyhunner

Description

@treyhunner

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixes3.15new features, bugs and security fixesdocsDocumentation in the Doc dirpendingThe issue will be closed if no feedback is provided

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions