NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

__future__.py (1625B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\carbon\common\stdlib\__future__.py
      2 all_feature_names = ['nested_scopes',
      3  'generators',
      4  'division',
      5  'absolute_import',
      6  'with_statement',
      7  'print_function',
      8  'unicode_literals']
      9 __all__ = ['all_feature_names'] + all_feature_names
     10 CO_NESTED = 16
     11 CO_GENERATOR_ALLOWED = 0
     12 CO_FUTURE_DIVISION = 8192
     13 CO_FUTURE_ABSOLUTE_IMPORT = 16384
     14 CO_FUTURE_WITH_STATEMENT = 32768
     15 CO_FUTURE_PRINT_FUNCTION = 65536
     16 CO_FUTURE_UNICODE_LITERALS = 131072
     17 
     18 class _Feature:
     19 
     20     def __init__(self, optionalRelease, mandatoryRelease, compiler_flag):
     21         self.optional = optionalRelease
     22         self.mandatory = mandatoryRelease
     23         self.compiler_flag = compiler_flag
     24 
     25     def getOptionalRelease(self):
     26         return self.optional
     27 
     28     def getMandatoryRelease(self):
     29         return self.mandatory
     30 
     31     def __repr__(self):
     32         return '_Feature' + repr((self.optional, self.mandatory, self.compiler_flag))
     33 
     34 
     35 nested_scopes = _Feature((2, 1, 0, 'beta', 1), (2, 2, 0, 'alpha', 0), CO_NESTED)
     36 generators = _Feature((2, 2, 0, 'alpha', 1), (2, 3, 0, 'final', 0), CO_GENERATOR_ALLOWED)
     37 division = _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), CO_FUTURE_DIVISION)
     38 absolute_import = _Feature((2, 5, 0, 'alpha', 1), (2, 7, 0, 'alpha', 0), CO_FUTURE_ABSOLUTE_IMPORT)
     39 with_statement = _Feature((2, 5, 0, 'alpha', 1), (2, 6, 0, 'alpha', 0), CO_FUTURE_WITH_STATEMENT)
     40 print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), CO_FUTURE_PRINT_FUNCTION)
     41 unicode_literals = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), CO_FUTURE_UNICODE_LITERALS)