zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
U
¸ý°dÊã@sªddlmZddlZddlmZddlmZddlmZddlmZddlmZej    rbd    d
l
m Z Gd d „d ee e fƒZ Gd d„deeedfeede ffƒZdS)é)Ú annotationsN)ÚAny)ÚDict)ÚTuple)ÚUnioné)ÚLiteralé)Ú
CacheConstc@s eZdZdZdddœdd„ZdS)Úprefix_anon_mapafA map that creates new keys for missing key access.
 
    Considers keys of the form "<ident> <name>" to produce
    new symbols "<name>_<index>", where "index" is an incrementing integer
    corresponding to <name>.
 
    Inlines the approach taken by :class:`sqlalchemy.util.PopulateDict` which
    is otherwise usually used for this type of operation.
 
    Ústr©ÚkeyÚreturncCsB| dd¡\}}| |d¡}|d||<|›d|›}|||<|S)Nú r    Ú_)ÚsplitÚget)ÚselfrÚidentZderivedZanonymous_counterÚvalue©rúNd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\sqlalchemy/sql/_py_util.pyÚ __missing__"s   zprefix_anon_map.__missing__N)Ú__name__Ú
__module__Ú __qualname__Ú__doc__rrrrrr s r c@s4eZdZdZdZdddœdd„Zdd    d
œd d „Zd S)Úcache_anon_mapaUA map that creates new keys for missing key access.
 
    Produces an incrementing sequence given a series of unique keys.
 
    This is similar to the compiler prefix_anon_map class although simpler.
 
    Inlines the approach taken by :class:`sqlalchemy.util.PopulateDict` which
    is otherwise usually used for this type of operation.
 
    rrzTuple[str, bool])Úobject_rcCsXt|ƒ}||kr,||}|dk    s$t‚|dfSt|jƒ||<}|jd7_|dfSdS)NTr    F)ÚidÚAssertionErrorr Ú_index)rrZidselfZs_valZid_rrrÚget_anon;s zcache_anon_map.get_anonÚintr r cCs$t|jƒ||<}|jd7_|S)Nr    )r r")rrÚvalrrrrIszcache_anon_map.__missing__N)rrrrr"r#rrrrrr+s rzLiteral[CacheConst.NO_CACHE]T)Ú
__future__rÚtypingrrrrZ util.typingrÚ TYPE_CHECKINGÚ    cache_keyr
r r r$rrrrrÚ<module>s       
ÿ