<s> """<STR_LIT>""" <EOL> from nuitka import Options <EOL> from . ConstantCodes import getConstantCode <EOL> from . ErrorCodes import ( <EOL> getErrorExitBoolCode , <EOL> getErrorExitCode , <EOL> getReleaseCode , <EOL> getReleaseCodes <EOL> ) <EOL> from . Helpers import generateChildExpressionsCode , generateExpressionCode <EOL> from . LabelCodes import getBranchingCode <EOL> from . PythonAPICodes import generateCAPIObjectCode , generateCAPIObjectCode0 <EOL> def generateAssignmentAttributeCode ( statement , emit , context ) : <EOL> lookup_source = statement . getLookupSource ( ) <EOL> attribute_name = statement . getAttributeName ( ) <EOL> value = statement . getAssignSource ( ) <EOL> value_name = context . allocateTempName ( "<STR_LIT>" ) <EOL> generateExpressionCode ( <EOL> to_name = value_name , <EOL> expression = value , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> target_name = context . allocateTempName ( "<STR_LIT>" ) <EOL> generateExpressionCode ( <EOL> to_name = target_name , <EOL> expression = lookup_source , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> old_source_ref = context . setCurrentSourceCodeReference ( <EOL> value . getSourceReference ( ) <EOL> if Options . isFullCompat ( ) else <EOL> statement . getSourceReference ( ) <EOL> ) <EOL> if attribute_name == "<STR_LIT>" : <EOL> getAttributeAssignmentDictSlotCode ( <EOL> target_name = target_name , <EOL> value_name = value_name , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> elif attribute_name == "<STR_LIT>" : <EOL> getAttributeAssignmentClassSlotCode ( <EOL> target_name = target_name , <EOL> value_name = value_name , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> else : <EOL> getAttributeAssignmentCode ( <EOL> target_name = target_name , <EOL> value_name = value_name , <EOL> attribute_name = getConstantCode ( <EOL> context = context , <EOL> constant = attribute_name <EOL> ) , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> context . setCurrentSourceCodeReference ( old_source_ref ) <EOL> def generateDelAttributeCode ( statement , emit , context ) : <EOL> target_name = context . allocateTempName ( "<STR_LIT>" ) <EOL> generateExpressionCode ( <EOL> to_name = target_name , <EOL> expression = statement . getLookupSource ( ) , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> old_source_ref = context . setCurrentSourceCodeReference ( <EOL> statement . getLookupSource ( ) . getSourceReference ( ) <EOL> if Options . isFullCompat ( ) else <EOL> statement . getSourceReference ( ) <EOL> ) <EOL> getAttributeDelCode ( <EOL> target_name = target_name , <EOL> attribute_name = getConstantCode ( <EOL> context = context , <EOL> constant = statement . getAttributeName ( ) <EOL> ) , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> context . setCurrentSourceCodeReference ( old_source_ref ) <EOL> def generateAttributeLookupCode ( to_name , expression , emit , context ) : <EOL> source_name , = generateChildExpressionsCode ( <EOL> expression = expression , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> attribute_name = expression . getAttributeName ( ) <EOL> getAttributeLookupCode ( <EOL> to_name = to_name , <EOL> source_name = source_name , <EOL> attribute_name = attribute_name , <EOL> needs_check = expression . getLookupSource ( ) . mayRaiseExceptionAttributeLookup ( <EOL> exception_type = BaseException , <EOL> attribute_name = attribute_name <EOL> ) , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> def getAttributeLookupCode ( to_name , source_name , attribute_name , needs_check , <EOL> emit , context ) : <EOL> if attribute_name == "<STR_LIT>" : <EOL> emit ( <EOL> "<STR_LIT>" % ( <EOL> to_name , <EOL> source_name <EOL> ) <EOL> ) <EOL> elif attribute_name == "<STR_LIT>" : <EOL> emit ( <EOL> "<STR_LIT>" % ( <EOL> to_name , <EOL> source_name <EOL> ) <EOL> ) <EOL> else : <EOL> emit ( <EOL> "<STR_LIT>" % ( <EOL> to_name , <EOL> source_name , <EOL> getConstantCode ( <EOL> context = context , <EOL> constant = attribute_name <EOL> ) <EOL> ) <EOL> ) <EOL> getReleaseCode ( <EOL> release_name = source_name , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> getErrorExitCode ( <EOL> check_name = to_name , <EOL> needs_check = needs_check , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> context . addCleanupTempName ( to_name ) <EOL> def getAttributeCheckBoolCode ( source_name , attr_name , needs_check , emit , context ) : <EOL> res_name = context . getIntResName ( ) <EOL> emit ( <EOL> "<STR_LIT>" % ( <EOL> res_name , <EOL> source_name , <EOL> attr_name <EOL> ) <EOL> ) <EOL> getReleaseCodes ( <EOL> release_names = ( source_name , attr_name ) , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> getErrorExitBoolCode ( <EOL> condition = "<STR_LIT>" % res_name , <EOL> needs_check = needs_check , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> getBranchingCode ( "<STR_LIT>" % res_name , emit , context ) <EOL> def getAttributeAssignmentCode ( target_name , attribute_name , value_name , emit , <EOL> context ) : <EOL> res_name = context . getBoolResName ( ) <EOL> emit ( <EOL> "<STR_LIT>" % ( <EOL> res_name , <EOL> target_name , <EOL> attribute_name , <EOL> value_name <EOL> ) <EOL> ) <EOL> getErrorExitBoolCode ( <EOL> condition = "<STR_LIT>" % res_name , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> getReleaseCodes ( <EOL> release_names = ( value_name , target_name , attribute_name ) , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> def getAttributeAssignmentDictSlotCode ( target_name , value_name , emit , context ) : <EOL> """<STR_LIT>""" <EOL> res_name = context . getBoolResName ( ) <EOL> emit ( <EOL> "<STR_LIT>" % ( <EOL> res_name , <EOL> target_name , <EOL> value_name <EOL> ) <EOL> ) <EOL> getErrorExitBoolCode ( <EOL> condition = "<STR_LIT>" % res_name , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> getReleaseCodes ( <EOL> release_names = ( value_name , target_name ) , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> def getAttributeAssignmentClassSlotCode ( target_name , value_name , emit , context ) : <EOL> """<STR_LIT>""" <EOL> res_name = context . getBoolResName ( ) <EOL> emit ( <EOL> "<STR_LIT>" % ( <EOL> res_name , <EOL> target_name , <EOL> value_name <EOL> ) <EOL> ) <EOL> getErrorExitBoolCode ( <EOL> condition = "<STR_LIT>" % res_name , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> getReleaseCodes ( <EOL> release_names = ( value_name , target_name ) , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> def getAttributeDelCode ( target_name , attribute_name , emit , context ) : <EOL> res_name = context . getIntResName ( ) <EOL> emit ( <EOL> "<STR_LIT>" % ( <EOL> res_name , <EOL> target_name , <EOL> attribute_name <EOL> ) <EOL> ) <EOL> getReleaseCodes ( <EOL> release_names = ( target_name , attribute_name ) , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> getErrorExitBoolCode ( <EOL> condition = "<STR_LIT>" % res_name , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> def generateAttributeLookupSpecialCode ( to_name , expression , emit , context ) : <EOL> source_name , = generateChildExpressionsCode ( <EOL> expression = expression , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> attribute_name = expression . getAttributeName ( ) <EOL> getAttributeLookupSpecialCode ( <EOL> to_name = to_name , <EOL> source_name = source_name , <EOL> attr_name = getConstantCode ( <EOL> context = context , <EOL> constant = attribute_name <EOL> ) , <EOL> needs_check = expression . getLookupSource ( ) . mayRaiseExceptionAttributeLookupSpecial ( <EOL> exception_type = BaseException , <EOL> attribute_name = attribute_name <EOL> ) , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> def getAttributeLookupSpecialCode ( to_name , source_name , attr_name , needs_check , <EOL> emit , context ) : <EOL> emit ( <EOL> "<STR_LIT>" % ( <EOL> to_name , <EOL> source_name , <EOL> attr_name , <EOL> ) <EOL> ) <EOL> getReleaseCodes ( <EOL> release_names = ( source_name , attr_name ) , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> getErrorExitCode ( <EOL> check_name = to_name , <EOL> emit = emit , <EOL> needs_check = needs_check , <EOL> context = context <EOL> ) <EOL> context . addCleanupTempName ( to_name ) <EOL> def generateBuiltinHasattrCode ( to_name , expression , emit , context ) : <EOL> generateCAPIObjectCode0 ( <EOL> to_name = to_name , <EOL> capi = "<STR_LIT>" , <EOL> arg_desc = ( <EOL> ( "<STR_LIT>" , expression . getLookupSource ( ) ) , <EOL> ( "<STR_LIT>" , expression . getAttribute ( ) ) , <EOL> ) , <EOL> may_raise = expression . mayRaiseException ( BaseException ) , <EOL> source_ref = expression . getCompatibleSourceReference ( ) , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> def generateBuiltinGetattrCode ( to_name , expression , emit , context ) : <EOL> generateCAPIObjectCode ( <EOL> to_name = to_name , <EOL> capi = "<STR_LIT>" , <EOL> arg_desc = ( <EOL> ( "<STR_LIT>" , expression . getLookupSource ( ) ) , <EOL> ( "<STR_LIT>" , expression . getAttribute ( ) ) , <EOL> ( "<STR_LIT>" , expression . getDefault ( ) ) , <EOL> ) , <EOL> may_raise = expression . mayRaiseException ( BaseException ) , <EOL> source_ref = expression . getCompatibleSourceReference ( ) , <EOL> none_null = True , <EOL> emit = emit , <EOL> context = context <EOL> ) <EOL> def generateBuiltinSetattrCode ( to_name , expression , emit , context ) : <EOL> generateCAPIObjectCode0 ( <EOL> to_name = to_name , <EOL> capi = "<STR_LIT>" , <EOL> arg_desc = ( <EOL> ( "<STR_LIT>" , expression . getLookupSource ( ) ) , <EOL> ( "<STR_LIT>" , expression . getAttribute ( ) ) , <EOL> ( "<STR_LIT>" , expression . getValue ( ) ) , <EOL> ) , <EOL> may_raise = expression . mayRaiseException ( BaseException ) , <EOL> source_ref = expression . getCompatibleSourceReference ( ) , <EOL> emit = emit , <EOL> context = context , <EOL> ) </s>
