Skip to content

Docs on global var produce different outputs #18139

@jm-positron

Description

@jm-positron

Summary

The docs on this page are inaccurate: https://docs.astral.sh/ruff/rules/global-statement/

The two examples produce slightly different outputs.

The original example produces:

10
10

vs

1
10

The examples should produce identical output.

Note I spent some time trying to find where in the project those docs are produced, but unfortuntately wasn't able to find it quickly. So this report just references the url.

Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationhelp wantedContributions especially welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions