Skip to content

Commit

Permalink
w
Browse files Browse the repository at this point in the history
  • Loading branch information
1cbyc committed Oct 18, 2023
1 parent 1514a00 commit e96c7b6
Show file tree
Hide file tree
Showing 15 changed files with 151 additions and 0 deletions.
Binary file modified .DS_Store
Binary file not shown.
70 changes: 70 additions & 0 deletions attrs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# SPDX-License-Identifier: MIT

from attr import (
NOTHING,
Attribute,
Factory,
__author__,
__copyright__,
__description__,
__doc__,
__email__,
__license__,
__title__,
__url__,
__version__,
__version_info__,
assoc,
cmp_using,
define,
evolve,
field,
fields,
fields_dict,
frozen,
has,
make_class,
mutable,
resolve_types,
validate,
)
from attr._next_gen import asdict, astuple

from . import converters, exceptions, filters, setters, validators


__all__ = [
"__author__",
"__copyright__",
"__description__",
"__doc__",
"__email__",
"__license__",
"__title__",
"__url__",
"__version__",
"__version_info__",
"asdict",
"assoc",
"astuple",
"Attribute",
"cmp_using",
"converters",
"define",
"evolve",
"exceptions",
"Factory",
"field",
"fields_dict",
"fields",
"filters",
"frozen",
"has",
"make_class",
"mutable",
"NOTHING",
"resolve_types",
"setters",
"validate",
"validators",
]
66 changes: 66 additions & 0 deletions attrs/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
from typing import (
Any,
Callable,
Dict,
Mapping,
Optional,
Sequence,
Tuple,
Type,
)

# Because we need to type our own stuff, we have to make everything from
# attr explicitly public too.
from attr import __author__ as __author__
from attr import __copyright__ as __copyright__
from attr import __description__ as __description__
from attr import __email__ as __email__
from attr import __license__ as __license__
from attr import __title__ as __title__
from attr import __url__ as __url__
from attr import __version__ as __version__
from attr import __version_info__ as __version_info__
from attr import _FilterType
from attr import assoc as assoc
from attr import Attribute as Attribute
from attr import cmp_using as cmp_using
from attr import converters as converters
from attr import define as define
from attr import evolve as evolve
from attr import exceptions as exceptions
from attr import Factory as Factory
from attr import field as field
from attr import fields as fields
from attr import fields_dict as fields_dict
from attr import filters as filters
from attr import frozen as frozen
from attr import has as has
from attr import make_class as make_class
from attr import mutable as mutable
from attr import NOTHING as NOTHING
from attr import resolve_types as resolve_types
from attr import setters as setters
from attr import validate as validate
from attr import validators as validators

# TODO: see definition of attr.asdict/astuple
def asdict(
inst: Any,
recurse: bool = ...,
filter: Optional[_FilterType[Any]] = ...,
dict_factory: Type[Mapping[Any, Any]] = ...,
retain_collection_types: bool = ...,
value_serializer: Optional[
Callable[[type, Attribute[Any], Any], Any]
] = ...,
tuple_keys: bool = ...,
) -> Dict[str, Any]: ...

# TODO: add support for returning NamedTuple from the mypy plugin
def astuple(
inst: Any,
recurse: bool = ...,
filter: Optional[_FilterType[Any]] = ...,
tuple_factory: Type[Sequence[Any]] = ...,
retain_collection_types: bool = ...,
) -> Tuple[Any, ...]: ...
Binary file added attrs/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file added attrs/__pycache__/converters.cpython-310.pyc
Binary file not shown.
Binary file added attrs/__pycache__/exceptions.cpython-310.pyc
Binary file not shown.
Binary file added attrs/__pycache__/filters.cpython-310.pyc
Binary file not shown.
Binary file added attrs/__pycache__/setters.cpython-310.pyc
Binary file not shown.
Binary file added attrs/__pycache__/validators.cpython-310.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions attrs/converters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: MIT

from attr.converters import * # noqa
3 changes: 3 additions & 0 deletions attrs/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: MIT

from attr.exceptions import * # noqa
3 changes: 3 additions & 0 deletions attrs/filters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: MIT

from attr.filters import * # noqa
Empty file added attrs/py.typed
Empty file.
3 changes: 3 additions & 0 deletions attrs/setters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: MIT

from attr.setters import * # noqa
3 changes: 3 additions & 0 deletions attrs/validators.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: MIT

from attr.validators import * # noqa

0 comments on commit e96c7b6

Please sign in to comment.