Skip to content

Update the docstring of untokenize() to match the docs #128519

Closed
@tomasr8

Description

@tomasr8

Documentation

In #128031, it was deemed too risky to change untokenize() to more closely match the original input string. We should update the docstring of untokenize to reflect that and prevent confusion in the (rare) case when untokenize does not match the input.

The docs already make that clear so we can simply reuse that explanation:

The reconstructed script is returned as a single string. The result is
guaranteed to tokenize back to match the input so that the conversion is
lossless and round-trips are assured. The guarantee applies only to the
token type and token string as the spacing between tokens (column
positions) may change.

Linked PRs

Metadata

Metadata

Assignees

Labels

docsDocumentation in the Doc dirstdlibPython modules in the Lib dirtopic-parser

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions