Skip to content

>0.5.8 issue with beartype>0.10.0 #450

@a-mckinley

Description

@a-mckinley

Description

I realise this is not likely to be a real "bug", but I discovered an issue using dataclasses-json in conjunction with beartype>0.10.0 with dataclasses-json >0.5.8.

Beartype complains about:

beartype.roar.BeartypeDecorHintForwardRefException: Forward reference "dataclasses_json.api.SchemaType[A]" syntactically invalid as module attribute name.

Code snippet that reproduces the issue

from dataclasses import dataclass
from dataclasses_json import dataclass_json
from beartype import beartype


@beartype
@dataclass_json
@dataclass
class Testing(object):
    data: str


t = Testing(data='thing')
print(t)

Describe the results you expected

beartype compatibility working

Python version you are using

3.11.3

Environment description

Working environments:

pip install -U beartype==0.15.0 dataclasses_json==0.5.8
pip install -U beartype==0.10.0 dataclasses_json==0.5.13

Failing environment:

pip install -U beartype==0.15.0 dataclasses_json==0.5.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    api/v0bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions