Skip to content

Regression in definition of UUID.int #14964

@erictraut

Description

@erictraut

A recent change in uuid.pyi results in a regression when accessing the int attribute of the UUID class. See this pyright bug for details.

At runtime, it is an error to have a __slots__ entry share the same name as a class variable. The UUID class definition violates this invariant.

To fix this, I think the UUID class definition should be modified in one of two ways:

  1. Remove the int from the slots definition, reverting the recent change
  2. Remove the int property and add a self.int: builtins.int instance variable annotation within the __init__ method

Option 2 is probably better since it more accurately models the runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions