Skip to content

ast: Improve behavior for user-defined classes #117486

Closed
@JelleZijlstra

Description

@JelleZijlstra

From @encukou:

          Thanks for the fix. Since it's a blocker I merged it, even though I'd have one more review comment:

It would be good to add this to the new test, and improve the behaviour (the error is quite opaque):

        class MoreFieldsThanTypes(ast.AST):
            _fields = ('a', 'b')
            _field_types = {'a': int | None}
            a: int | None = None
            b: int | None = None

Originally posted by @encukou in #117266 (comment)

Based on robotframework/robotframework#5091 (comment), we should also document _field_types.

Linked PRs

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions