⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.24
Server IP:
50.6.168.112
Server:
Linux server-617809.webnetzimbabwe.com 5.14.0-570.25.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 9 04:57:09 EDT 2025 x86_64
Server Software:
Apache
PHP Version:
8.4.10
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python3.9
/
site-packages
/
attr
/
__pycache__
/
View File Name :
converters.cpython-39.opt-1.pyc
a PÍ£_¦ ã @ sN d Z ddlmZmZmZ ddlmZmZmZ g d¢Z dd„ Z edfd d „ZdS )z Commonly useful converters. é )Úabsolute_importÚdivisionÚprint_functioné )ÚNOTHINGÚFactoryÚpipe)r ÚoptionalÚdefault_if_nonec s ‡ fdd„}|S )z÷ 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 c s | d u rd S ˆ | ƒS ©N© ©Úval©Ú converterr ú3/usr/lib/python3.9/site-packages/attr/converters.pyÚoptional_converter s z$optional.
.optional_converterr )r r r r r r s r Nc sv ˆ t u r|du rtdƒ‚ˆ t ur0|dur0tdƒ‚|dur@t|ƒ‰ tˆ tƒrfˆ jrXtdƒ‚‡ fdd„}n‡ fdd„}|S )a› 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 Nz(Must pass either `default` or `factory`.z5Must pass either `default` or `factory` but not both.z1`takes_self` is not supported by default_if_none.c s | d ur| S ˆ ¡ S r )Úfactoryr ©Údefaultr r Údefault_if_none_converterG s z2default_if_none.
.default_if_none_converterc s | d ur| S ˆ S r r r r r r r O s )r Ú TypeErrorr Ú isinstanceZ takes_selfÚ ValueError)r r r r r r r $ s ÿ ÿr )Ú__doc__Z __future__r r r Ú_maker r r Ú__all__r r r r r r Ú
s