Skip to content

v0.35.1-bugfix #177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ for complex and *nested dataclass* models!
>>> from dataclass_wizard import JSONWizard
...
>>> @dataclass
... class MyClass(JSONWizard, key_case='AUTO'):
... class MyClass(JSONWizard):
... my_str: str | None
... is_active_tuple: tuple[bool, ...]
... list_of_int: list[int] = field(default_factory=list)
Expand Down
2 changes: 0 additions & 2 deletions dataclass_wizard/v1/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,6 @@ def load_to_pattern(self, tp: TypeInfo, extras: Extras):
fn_gen = extras['fn_gen']
_locals = extras['locals']

assert 'cls' not in _locals

is_datetime \
= is_date \
= is_time \
Expand Down
5 changes: 3 additions & 2 deletions dataclass_wizard/wizard_mixins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ __all__ = ['JSONListWizard',

import json
from os import PathLike
from typing import AnyStr, TextIO, BinaryIO
from typing import AnyStr, TextIO, BinaryIO, Union, TypeAlias

from .abstractions import W
from .enums import LetterCase
Expand All @@ -17,7 +17,8 @@ from .type_def import (T, ListOfJSONObject,

# A type that can be string or `path.Path`
# https://stackoverflow.com/a/78070015/10237506
type FileType = str | bytes | PathLike
# A type that can be string, bytes, or `PathLike`
FileType: TypeAlias = Union[str, bytes, PathLike]


class JSONListWizard(JSONSerializable, str=False):
Expand Down
4 changes: 2 additions & 2 deletions docs/common_use_cases/v1_alias.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ for bulk aliasing:
print(t.to_dict())
# > {'my_str': 'test', 'myDumpedBool': True, 'MyInt': 123, 'DumpedInt': 321}

AliasPath
---------
Alias Paths
-----------

Maps one or more nested JSON paths to a dataclass field. See documentation on :func:`AliasPath` for more details.

Expand Down