ACIL FM
Dark
Refresh
Current DIR:
/usr/lib/python3.9/site-packages/attr
/
usr
lib
python3.9
site-packages
attr
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
__pycache__
-
chmod
Open
Rename
Delete
converters.py
2.16 MB
chmod
View
DL
Edit
Rename
Delete
converters.pyi
380 B
chmod
View
DL
Edit
Rename
Delete
exceptions.py
1.9 MB
chmod
View
DL
Edit
Rename
Delete
exceptions.pyi
539 B
chmod
View
DL
Edit
Rename
Delete
filters.py
1.07 MB
chmod
View
DL
Edit
Rename
Delete
filters.pyi
214 B
chmod
View
DL
Edit
Rename
Delete
py.typed
0 B
chmod
View
DL
Edit
Rename
Delete
setters.py
1.4 MB
chmod
View
DL
Edit
Rename
Delete
setters.pyi
567 B
chmod
View
DL
Edit
Rename
Delete
validators.py
11.23 MB
chmod
View
DL
Edit
Rename
Delete
validators.pyi
1.82 MB
chmod
View
DL
Edit
Rename
Delete
_compat.py
7.14 MB
chmod
View
DL
Edit
Rename
Delete
_config.py
514 B
chmod
View
DL
Edit
Rename
Delete
_funcs.py
12.77 MB
chmod
View
DL
Edit
Rename
Delete
_make.py
86.24 MB
chmod
View
DL
Edit
Rename
Delete
_next_gen.py
4.04 MB
chmod
View
DL
Edit
Rename
Delete
_version_info.py
2.11 MB
chmod
View
DL
Edit
Rename
Delete
_version_info.pyi
209 B
chmod
View
DL
Edit
Rename
Delete
__init__.py
1.53 MB
chmod
View
DL
Edit
Rename
Delete
__init__.pyi
12.68 MB
chmod
View
DL
Edit
Rename
Delete
Edit file: /usr/lib/python3.9/site-packages/attr/converters.py
""" Commonly useful converters. """ from __future__ import absolute_import, division, print_function from ._make import NOTHING, Factory, pipe __all__ = [ "pipe", "optional", "default_if_none", ] def optional(converter): """ A converter that allows an attribute to be optional. An optional attribute is one which can be set to ``None``. :param callable converter: the converter that is used for non-``None`` values. .. versionadded:: 17.1.0 """ def optional_converter(val): if val is None: return None return converter(val) return optional_converter def default_if_none(default=NOTHING, factory=None): """ A converter that allows to replace ``None`` values by *default* or the result of *factory*. :param default: Value to be used if ``None`` is passed. Passing an instance of `attr.Factory` is supported, however the ``takes_self`` option is *not*. :param callable factory: A callable that takes not parameters whose result is used if ``None`` is passed. :raises TypeError: If **neither** *default* or *factory* is passed. :raises TypeError: If **both** *default* and *factory* are passed. :raises ValueError: If an instance of `attr.Factory` is passed with ``takes_self=True``. .. versionadded:: 18.2.0 """ if default is NOTHING and factory is None: raise TypeError("Must pass either `default` or `factory`.") if default is not NOTHING and factory is not None: raise TypeError( "Must pass either `default` or `factory` but not both." ) if factory is not None: default = Factory(factory) if isinstance(default, Factory): if default.takes_self: raise ValueError( "`takes_self` is not supported by default_if_none." ) def default_if_none_converter(val): if val is not None: return val return default.factory() else: def default_if_none_converter(val): if val is not None: return val return default return default_if_none_converter
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply