Skip to content

VType rejects new python 3.13 generated attributes __static_attributes__ and __firstlineno__ #4

@burnpanck

Description

@burnpanck

A custom VType of mine that previously worked, fails on python 3.13:

TypeError: a VType can not define any class attribute except for ('__type__', '__validators__', '__help_msg__', '__error_type__', '__module__', '__qualname__', '__doc__', '__orig_bases__'). Found: {'__static_attributes__', '__firstlineno__'}

The two attributes in question (__static_attributes__ and __firstlineno__) are new in python 3.13.

I should be able to whip-up a PR quickly enough. There are a number of ways to fix that:

  1. Explicitly create the correct list of acceptable attributes in a version-dependent fashion.
  2. Introspecting a "golden" reference type, and taking those attributes as acceptable.
  3. Blanket allowance of double-underscore attributes.

I'm tempted to suggest to go for 3 - it feels the most pythonic. What do you think?

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