U kf}@sddlmZddlZddlmZddlmZddlmZddlmZddlmZej rbd d l m Z Gd d d ee e fZ Gd ddeeedfeede ffZdS)) annotationsN)Any)Dict)Tuple)Union)Literal) CacheConstc@s eZdZdZdddddZdS)prefix_anon_mapafA map that creates new keys for missing key access. Considers keys of the form " " to produce new symbols "_", where "index" is an incrementing integer corresponding to . Inlines the approach taken by :class:`sqlalchemy.util.PopulateDict` which is otherwise usually used for this type of operation. strkeyreturncCsB|dd\}}||d}|d||<|d|}|||<|S)N r _)splitget)selfridentZderivedZanonymous_countervaluerG/opt/hc_python/lib64/python3.8/site-packages/sqlalchemy/sql/_py_util.py __missing__"s   zprefix_anon_map.__missing__N)__name__ __module__ __qualname____doc__rrrrrr s r c@s4eZdZdZdZdddddZdd 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)idAssertionErrorr _index)rrZidselfZs_valZid_rrrget_anon;s zcache_anon_map.get_anonintr r cCs$t|j||<}|jd7_|S)Nr )r r")rrvalrrrrHszcache_anon_map.__missing__N)rrrrr"r#rrrrrr+s  rzLiteral[CacheConst.NO_CACHE]T) __future__rtypingrrrrZ util.typingr TYPE_CHECKING cache_keyr r r r$rrrrrs