
    ij                       U d dl mZ d dlZd dlZd dlZd dlZd dlmZ d dlmZ d dl	m
Z
mZ d dlmZmZmZ d dlmZ d dlmZmZ d d	lmZmZ  G d
 d          Zh dZded<   eh dz  dhz
  Zded<    e eedhz
                      Zded<   dZded<   dZ ded<   dZ!ded<   dZ"ded<   dZ#ded<   dZ$ded<    e%e!e#e$f          Z&ded <    e%ee e"f          Z'ded!<    G d" d#          Z(dS )$    )annotationsN)Callable)Pattern)AnyFinal)WriteBuffer
write_bool	write_str)defaults)	ErrorCodeerror_codes)get_class_descriptorsreplace_object_statec                  :    e Zd ZU dZded<   dZded<   dZded<   dS )		BuildTyper   r   STANDARD   MODULE   PROGRAM_TEXTN)__name__
__module____qualname__r   __annotations__r   r        K/root/projects/qq-shell/venv/lib64/python3.11/site-packages/mypy/options.pyr   r      sE         HFLr   r   >'   mypycalways_truedebug_cachealways_falseextra_checksignore_errorsfollow_importswarn_no_returnstrict_equalitystrict_optionalwarn_return_anywarn_unreachabledisallow_any_exprenable_error_codeimplicit_optionalimplicit_reexportcheck_untyped_defsdisable_error_codestrict_concatenateenabled_error_codeslocal_partial_typeswarn_unused_ignoresdisabled_error_codesallow_untyped_globalsdisallow_any_explicitdisallow_any_genericsdisallow_untyped_defsallow_redefinition_newallow_redefinition_olddisallow_any_decorateddisallow_untyped_callsfollow_untyped_importsignore_missing_importsdisallow_any_unimporteddisallow_incomplete_defsdisallow_subclassing_anyfollow_imports_for_stubsstrict_equality_for_nonedisallow_untyped_decoratorsr   PER_MODULE_OPTIONS>   bazelpluginsplatformstrict_bytesnative_parserfixed_format_cacheold_type_inferenceuntyped_calls_excludeenable_incomplete_featuredisable_bytearray_promotiondisable_memoryview_promotionr    OPTIONS_AFFECTING_CACHErH   #OPTIONS_AFFECTING_CACHE_NO_PLATFORMTypeVarTupleTYPE_VAR_TUPLEUnpackUNPACKPreciseTupleTypesPRECISE_TUPLE_TYPESNewGenericSyntaxNEW_GENERIC_SYNTAXInlineTypedDictINLINE_TYPEDDICTTypeForm	TYPE_FORMINCOMPLETE_FEATURESCOMPLETE_FEATURESc                      e Zd ZdZd dZd!dZd"dZd#d
Zd$dZd%dZ	d dZ
d&dZd'dZd dZd(dZd)dZd*dZd+dZdS ),OptionszOptions collected from flags.returnNonec                   d | _         t          j        | _        t          j        d d         | _        t          j        | _        t          j
        d          }|dk    r|| _        nt          j        | _        d | _        d | _        d | _        g | _        i | _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        g | _        d| _        d| _        d| _        d| _        d| _        d| _         d| _!        g | _"        d| _#        d| _$        d| _%        d| _&        d| _'        d| _(        d| _)        d| _*        d| _+        d| _,        g | _-        d| _.        d| _/        d| _0        d| _1        d| _2        d| _3        d| _4        d| _5        d| _6        d| _7        d| _8        d| _9        d| _:        d| _;        d| _<        d| _=        d| _>        d| _?        g | _@        g | _A        g | _B        t                      | _D        g | _E        t                      | _F        d| _G        d | _H        d | _I        d | _J        d | _K        d | _L        d | _M        d| _N        d| _O        t          jQ        | _R        d| _S        d| _T        d| _U        d| _V        d| _W        d| _X        d| _Y        d| _Z        d| _[        d| _\        d| _]        d| _^        d| __        g | _`        i | _a        g | _b        t                      | _c        d| _d        d| _e        d| _f        d| _g        d| _h        d| _i        d| _j        g | _k        d | _l        d | _m        d| _n        d| _o        d| _p        d| _q        d | _r        d| _s        d| _t        d| _u        d| _v        d| _w        d| _x        d| _y        d| _z        d| _{        d| _|        d| _}        d| _~        d| _        g | _        i | _        d| _        d| _        d| _        d | _        d| _        d| _        d| _        t          j        | _        d| _        d| _        d| _        d| _        d| _        d| _        d | _        d | _        d| _        d S )	Nr   MACHDEP
emscriptenFnormalTglobalr   )_per_module_cacher   r   
build_typesysversion_infopython_version
executablepython_executable	sysconfigget_config_varrH   custom_typing_modulecustom_typeshed_dirabs_custom_typeshed_dir	mypy_pathreport_dirsno_silence_site_packagesno_site_packagesr>   !ignore_missing_imports_per_moduler=   r$   rB   namespace_packagesexplicit_package_basesexcludeexclude_gitignorer7   r?   r*   r;   r6   r<   rM   r8   r@   r.   rD   rA   warn_incomplete_stubwarn_redundant_castsr%   r(   report_deprecated_as_notedeprecated_calls_excluder3   warn_unused_configsr#   r'   show_error_contextcolor_outputerror_summaryr,   r-   r5   r:   r9   r&   rC   rI   r0   r"   r)   r   r!   r/   setr4   r+   r1   scripts_are_modulesconfig_filequickstart_filefilespackagesmodules	junit_xmljunit_formatincrementalr   	CACHE_DIR	cache_dirsqlite_cacherK   r    skip_version_checkskip_cache_mtime_checksfine_grained_incrementalcache_fine_graineduse_fine_grained_cachedebug_serializer   inspectionspreserve_astsinclude_docstringsrG   per_module_options_glob_optionsunused_configs	verbositypdbshow_tracebackraise_exceptionsdump_type_statsdump_inference_statsdump_build_statsrN   timing_statsline_checking_statssemantic_analysis_onlyuse_builtins_fixturestest_envnum_workersshadow_fileshow_column_numbersshow_error_endhide_error_codesshow_error_code_linksreveal_verbose_typespretty
dump_graph	dump_depslogical_depsr2   rJ   rF   export_typespackage_root	cache_map	fast_exitfast_module_lookupallow_empty_bodiestransform_sourceshow_absolute_pathinstall_typesnon_interactiveMANY_ERRORS_THRESHOLDmany_errors_thresholdrL   disable_expression_cacheexport_ref_infopos_only_special_methodsrO   rP   outputmypyc_annotation_filemypyc_skip_c_generation)selfrf   s     r   __init__zOptions.__init__f   s   <@ $,/2/?/C .1^ *955l""#DMMLDM04!/3 37$$&+-(-% %&+#16.&+#& ).%
 #' ',#"$', &+"',$!&&+#%*" ',# 13" &+" ).% #( ,1( ).% %*! %*! #  % */& 46% $)  $)  #  $ #( !! "' "& &+" ',# ',#  % ).% " #( " !& ') (* .047EE! -/3655  $)  (,
 ,0 (,
 +/ *. &*!)  !+ "& "'',$(-%"'&+#  % 

 ! # #( #% AC=?(+ # %$$)! %46&(,/3  ',# &+"  !"37). $) %%*"$)!!#( "
! (*57"'"' >B(-"  % &.%C""'(-%  % )-%+0(,1) #' 26" (-$$$r   boolc                (    | j         dk    p| j         S )N)      )rn   r   r   s    r   use_star_unpackzOptions.use_star_unpack  s    "g-NT5N1NNr   dict[str, object]c                    t          t          | dd                    }t          t                    D ]%}t	          | |          rt          | |          ||<   &d |                                D             }|S )z,Produce a comparable snapshot of this Option__dict__r   c                D    i | ]\  }}|                     d           ||S )_)
startswith).0kvs      r   
<dictcomp>z$Options.snapshot.<locals>.<dictcomp>  s/    AAAdaq||C/@/@AQAAAr   )dictgetattrr   rb   hasattritems)r   dr   s      r   snapshotzOptions.snapshot  sz     z2..//&w// 	( 	(AtQ (tQ''!AAaggiiAAAr   strc                V    dt          j        |                                            dS )NzOptions())pprintpformatr   r   s    r   __repr__zOptions.__repr__  s%    <&.99<<<<r   error_callbackCallable[[str], Any]c                  t          | j                  }t          | j                  }t          t          j                              }||z  |z
  }|r. |dd                    t          |                                | xj        d |D             z  c_        | xj        d |D             z  c_        | xj        | j        z  c_        dS )z?Process `--enable-error-code` and `--disable-error-code` flags.zInvalid error code(s): z, c                (    h | ]}t           |         S r   r   r   codes     r   	<setcomp>z.Options.process_error_codes.<locals>.<setcomp>  s    %X%X%XDk$&7%X%X%Xr   c                (    h | ]}t           |         S r   r   r   s     r   r   z.Options.process_error_codes.<locals>.<setcomp>  s    $V$V$V4[%6$V$V$Vr   N)	r   r/   r+   r   keysjoinsortedr4   r1   )r   r   disabled_code_namesenabled_code_namesvalid_error_code_namesinvalid_code_names_heres         r   process_error_codeszOptions.process_error_codes  s    !$"9:: !788!$[%5%7%7!8!8 !44"## # 	cNaTYYvF]?^?^5_5_aabbb!!%X%XDW%X%X%XX!!  $V$VCU$V$V$VV   	!!T%==!!!!r   warning_callbackc                   | j         D ]9}|t          t          z  vr |d|            |t          v r |d| d           :d S )NzUnknown incomplete feature: z	Warning: z is already enabled by default)rN   r_   r`   )r   r   r   features       r   process_incomplete_featuresz#Options.process_incomplete_features  sy     5 	V 	VG14EEEEGgGGHHH+++  !TW!T!T!TUUU		V 	Vr   c                f    | j         rd| _        d| _        d S | j        r| j        rd| _         d S d S d S )NT)rI   rO   rP   r   s    r   process_strict_byteszOptions.process_strict_bytes  sZ     	%/3D,04D---- 	%$2S 	% $D	% 	% 	% 	%r   changesc                x   t                      }t          || d           |                                D ]\  }}t          |||           |                    d          rd|_        | j                                        |_        | j                                        |_        |j	        D ]C}t          |         }|j                            |           |j                            |           D|j        D ]C}t          |         }|j                            |           |j                            |           D|S )NT)	copy_dictr>   )rb   r   r   setattrgetrz   r4   copyr1   r/   r   adddiscardr+   )r   r   new_optionskeyvaluecode_strr   s          r   apply_changeszOptions.apply_changes  sA   ii[$$????!--// 	- 	-JCKe,,,,;;/00 	A =AK9 ,0+D+I+I+K+K(*.*B*G*G*I*I'#6 	: 	:Hx(D,00666+33D9999#5 	; 	;Hx(D+//555,44T::::r   other_snapshotc                    t                                          |                                                                           t                                          |                                          k    S )a  Compare options in a way that is stable for snapshot() -> apply_changes() roundtrip.

        This is needed because apply_changes() has non-trivial effects for some flags, so
        Options().apply_changes(options.snapshot()) may result in a (slightly) different object.
        )rb   r
  r   )r   r  s     r   compare_stablezOptions.compare_stable  sY     II##DMMOO44==??yy&&~66??AAB	
r   c                8   i | _         d | j                                        D             }d | j                                        D             }t          d |D                       }d |D             }|D ]1}| j                            ||                     |          f           2t          |          | _        ||z   D ]?}| 	                    |          }|
                    | j        |                   | j         |<   @| j                            |           d S )Nc                *    g | ]}d |dd         v |S *Nr   r   r   s     r   
<listcomp>z2Options.build_per_module_cache.<locals>.<listcomp>$  s*    !]!]!]sVWX[Y[X[V\}}!}}}r   c                *    g | ]}d |dd         v|S r  r   r  s     r   r  z2Options.build_per_module_cache.<locals>.<listcomp>%  s/    ZZZSTUXVXUXSYHYHY1HYHYHYr   c              3  D   K   | ]}|                     d           |V  dS ).*Nendswithr  s     r   	<genexpr>z1Options.build_per_module_cache.<locals>.<genexpr>&  s3      JJD9I9IJ1JJJJJJr   c                <    g | ]}|                     d           |S )r  r  r  s     r   r  z2Options.build_per_module_cache.<locals>.<listcomp>'  s)    GGG!ajj6F6FGAGGGr   )rj   r   r   r   r   appendcompile_globr   r   clone_for_moduler
  update)r   unstructured_glob_keysstructured_keys	wildcardsconcreteglobr  optionss           r   build_per_module_cachezOptions.build_per_module_cache  sC   !#" "^!]T-D-I-I-K-K!]!]!]ZZd&=&B&B&D&DZZZJJoJJJJJ	GGGGG* 	G 	GD%%tT->->t-D-D&EFFFF ""899x' 	^ 	^C ++C00G*1*?*?@WX[@\*]*]D"3'' 	""?33333r   modulec                   | j         |                                  | j         J || j         v r'| j                            |           | j         |         S | }|                    d          }t          t          |          dd          D ]U}d                    |d|         dgz             }|| j         v r)| j                            |           | j         |         } nV|                    d          s\| j	        D ]T\  }}|
                    |          r:| j                            |           |                    | j        |                   }U|S )zCreate an Options object that incorporates per-module options.

        NOTE: Once this method is called all Options objects should be
        considered read-only, else the caching might be incorrect.
        N.r   r  r  r  )rj   r&  r   r  splitrangelenr   r  r   matchr
  r   )r   r'  r%  pathir  patterns          r   r  zOptions.clone_for_module=  sv    !)'')))%111 T+++''///)&11 ||C  s4yy!R(( 	 	A((48se+,,Cd,,,#++C00005 - t$$ 	R $ 2 R RW==(( R'//444%33D4KC4PQQG r   sPattern[str]c                   |                     d          }|d         dk    rt          j        |d                   nd}|dd          D ]$}||dk    rt          j        d|z             ndz  }%t          j        |dz             S )Nr)  r   r  r  r   z(\..*)?z\Z)r*  reescapecompile)r   r1  partsexprparts        r   r  zOptions.compile_globh  s     &+Ah#ooryq"""4!""I 	I 	IDTS[[BIcDj)))jHDDz$,'''r   tuple[str, list[object]]c                    g }t           D ]D}t          | |          }|dv rt          d |D                       }|                    |           E| j        |fS )aO  Return (platform, [values...]) for options that affect the cache.

        The list contains values for OPTIONS_AFFECTING_CACHE_NO_PLATFORM
        in sorted attribute name order. Keys are omitted since the cache
        is invalidated when the mypy version changes, and keys are constant
        on any specific mypy version.
        )r4   r1   c                    g | ]	}|j         
S r   )r   r   s     r   r  z:Options.select_options_affecting_cache.<locals>.<listcomp>~  s    888Ddi888r   )rR   r   r   r  rH   )r   resultoptvals       r   select_options_affecting_cachez&Options.select_options_affecting_cacher  sq      "6 	 	C$$$CEEE88C88899MM#}f$$r   bytesc                    t                      }t          || j                   t          || j                   t          || j                   |                                S )zReturn opaque bytes with options that can affect dependent modules as well.

        The value can be compared for equality to detect changed options.
        )r   r	   r>   r
   r$   rB   getvalue)r   bufs     r   dep_import_optionszOptions.dep_import_options  sT    
 mm33444#t*+++35666||~~r   N)rc   rd   )rc   r   )rc   r   )rc   r   )r   r   rc   rd   )r   r   r   r   rc   rd   )r   r   rc   rb   )r  r   rc   r   )r'  r   rc   rb   )r1  r   rc   r2  )rc   r:  )rc   rA  )r   r   r   __doc__r   r   r   r   r   r   r   r
  r  r&  r  r  r@  rE  r   r   r   rb   rb   c   sA       ''M- M- M- M-^
O O O O	 	 	 	= = = => > > >&V V V V% % % %   4	
 	
 	
 	
)4 )4 )4 )4V) ) ) )V( ( ( (% % % % 	 	 	 	 	 	r   rb   ))
__future__r   r   r4  rl   rq   collections.abcr   r   typingr   r   librt.internalr   r	   r
   mypyr   mypy.errorcodesr   r   	mypy.utilr   r   r   rE   r   rQ   tupler   rR   rT   rV   rX   rZ   r\   r^   	frozensetr_   r`   rb   r   r   r   <module>rP     s   " " " " " " "  				 



     $ $ $ $ $ $               = = = = = = = = = =       2 2 2 2 2 2 2 2 A A A A A A A A       ) ) )  ) ) ) )X    O"     & .3U66:QU_T`:`3a3a-b-b # b b b b ' & & & &    0  0 0 0 0.  . . . .+  + + + +	    &Y(;=My'YZZ  Z Z Z Z$9nf>P%QRR  R R R Rh h h h h h h h h hr   