Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
class_registry.cpython-313.pyc45 linesDownload Raw Back to __pycache__
1�

2��j�����SrSSKJr SSKrSSKJr \R(aSSKJr \	\r30rS
Sjr\RSS.SS	jj5r\RSS.SS4jj5rSS.SSjjrg)a!A registry of :class:`Schema <marshmallow.Schema>` classes. This allows for string5lookup of schemas, which may be used with6class:`fields.Nested <marshmallow.fields.Nested>`.7 8.. warning::9 10    This module is treated as private API.11    Users should not need to use this module directly.12�)�annotationsN)�
RegistryError)�Schemac�P^�URmTSU3nU[;a:[U4Sj[U55(d[URU5 OU[;a13U/[U'U[;a&[R	U/5RU5 gU/[U'g)atAdd a class to the registry of serializer classes. When a class is14registered, an entry for both its classname and its full, module-qualified15path are added to the registry.16 17Example: ::18 19    class MyClass:20        pass21 22 23    register("MyClass", MyClass)24    # Registry:25    # {26    #   'MyClass': [path.to.MyClass],27    #   'path.to.MyClass': [path.to.MyClass],28    # }29 30�.c3�@># �UHoRT:Hv� M g7f�N)�31__module__)�.0�each�modules  ��`D:\code\apps\devtools\python\user_packages\Python313\site-packages\marshmallow/class_registry.py�	<genexpr>�register.<locals>.<genexpr>9s����*�.B�d���6�!�.B�s�N)r32�	_registry�any�append�33setdefault)�	classname�cls�fullpathr
s   @r�registerrs����(�^�^�F����9�+�&�H��I��c�*�.7�	�.B�*�'�'�	�)��#�#�C�(�	�)�	#� #�u�	�)���y� ����X�r�*�1�1�#�6� #�e�	�(��.)�allc��gr	��rrs  r�	get_classrHs��RUrc��gr	rrs  rrrLs��rFc���[Un[U5S:�a U(a	[U$[SU<S35e[US$![an[SU<S35UeSnAff=f)z�Retrieve a class from the registry.34 35:raises: `marshmallow.exceptions.RegistryError` if the class cannot be found36    or if there are multiple entries for the given class name.37zClass with name z1 was not found. You may need to import the class.N�zMultiple classes with name z8 were found. Please use the full, module-qualified path.r)r�KeyErrorr�len)rr�classes�errors    rrrRs�����I�&���7�|�a����Y�'�'��)�)��7%�
%�38�	39�40�Y���"�"������y�m�,#�
#�41��	���s�	A�42A&�A!�!A&)r�strr�43SchemaType�return�None)rr&rztyping.Literal[False]r(r')rr&rztyping.Literal[True]r(zlist[SchemaType])rr&r�boolr(zlist[SchemaType] | SchemaType)�__doc__�44__future__r�typing�marshmallow.exceptionsr�
TYPE_CHECKING�marshmallowr�typer'rr�overloadrrrr�<module>r3s����#�
�0�	���"��f��J�
�	�'$�T���>A�U��U����36����0������45.3�#�#r
codekingpro/portable-devtools · Team Ai