PKє6>&EGG-INFO/PKG-INFOMetadata-Version: 1.0 Name: RuleDispatch Version: 0.5a0.dev-r2306 Summary: Rule-based Dispatching and Generic Functions Home-page: UNKNOWN Author: Phillip J. Eby Author-email: peak@eby-sarna.com License: PSF or ZPL Description: UNKNOWN Platform: UNKNOWN PKє6 #EGG-INFO/SOURCES.txt.cvsignore TODO.txt setup.cfg setup.py ez_setup/README.txt ez_setup/__init__.py src/RuleDispatch.egg-info/PKG-INFO src/RuleDispatch.egg-info/SOURCES.txt src/RuleDispatch.egg-info/dependency_links.txt src/RuleDispatch.egg-info/native_libs.txt src/RuleDispatch.egg-info/requires.txt src/RuleDispatch.egg-info/top_level.txt src/RuleDispatch.egg-info/zip-safe src/dispatch/__init__.py src/dispatch/_d_speedups.c src/dispatch/_d_speedups.pyx src/dispatch/ast_builder.py src/dispatch/combiners.py src/dispatch/combiners.txt src/dispatch/functions.py src/dispatch/interfaces.py src/dispatch/predicates.py src/dispatch/strategy.py src/dispatch/tests/__init__.py src/dispatch/tests/doctest.py src/dispatch/tests/test_dispatch.py src/dispatch/tests/test_parsing.py PKє62EGG-INFO/dependency_links.txt PKҔ6/EGG-INFO/native_libs.txtdispatch/_d_speedups.so PKє6EGG-INFO/requires.txtPyProtocols>=1.0a0dev-r2302PKє6 EGG-INFO/top_level.txtdispatch PK}52EGG-INFO/zip-safe PKEk6dispatch/__init__.py"""Multiple/Predicate Dispatch Framework This framework refines the algorithms of Chambers and Chen in their 1999 paper, "Efficient Multiple and Predicate Dispatching", to make them suitable for Python, while adding a few other enhancements like incremental index building and lazy expansion of the dispatch DAG. Also, their algorithm was designed only for class selection and true/false tests, while this framework can be used with any kind of test, such as numeric ranges, or custom tests such as categorization/hierarchy membership. NOTE: this package is not yet ready for prime-time. APIs are subject to change randomly without notice. You have been warned! TODO * Support DAG-walking for visualization, debugging, and ambiguity detection """ from dispatch.interfaces import * from types import ClassType as _ClassType _cls = _ClassType,type def generic(combiner=None): """Use the following function as the skeleton for a generic function Decorate a Python function so that it wraps an instance of 'dispatch.functions.GenericFunction' that has been configured with the decorated function's name, docstring, argument signature, and default arguments. The decorated function will have additional attributes besides those of a normal function. (See 'dispatch.IGenericFunction' for more information on these special attributes/methods.) Most commonly, you will use the 'when()' method of the decorated function to define "rules" or "methods" of the generic function. For example:: import dispatch @dispatch.generic() def someFunction(*args): '''This is a generic function''' @someFunction.when("len(args)>0") def argsPassed(*args): print "Arguments were passed!" @someFunction.when("len(args)==0") def noArgsPassed(*args): print "No arguments were passed!" someFunction() # prints "No args passed" someFunction(1) # prints "args passed" Note that when using older Python versions, you must use '[dispatch.generic()]' instead of '@dispatch.generic()'. """ from dispatch.functions import GenericFunction, AbstractGeneric from peak.util.decorators import decorate_assignment if combiner is None: def callback(frm,name,value,old_locals): return GenericFunction(value).delegate elif isinstance(combiner,_cls) and issubclass(combiner,AbstractGeneric): def callback(frm,name,value,old_locals): return combiner(value).delegate else: def callback(frm,name,value,old_locals): gf = GenericFunction(value) gf.combine = combiner return gf.delegate return decorate_assignment(callback) def as(*decorators): """Use Python 2.4 decorators w/Python 2.2+ Example: import dispatch class Foo(object): [dispatch.as(classmethod)] def something(cls,etc): \"""This is a classmethod\""" """ if len(decorators)>1: decorators = list(decorators) decorators.reverse() def callback(frame,k,v,old_locals): for d in decorators: v = d(v) return v from peak.util.decorators import decorate_assignment return decorate_assignment(callback) def on(argument_name): """Decorate the following function as a single-dispatch generic function Single-dispatch generic functions may have a slight speed advantage over predicate-dispatch generic functions when you only need to dispatch based on a single argument's type or protocol, and do not need arbitrary predicates. Also, single-dispatch functions do not require you to adapt the dispatch argument when dispatching based on protocol or interface, and if the dispatch argument has a '__conform__' method, it will attempt to use it, rather than simply dispatching based on class information the way predicate dispatch functions do. The created generic function will use the documentation from the supplied function as its docstring. And, it will dispatch methods based on the argument named by 'argument_name', and otherwise keeping the same argument signature, defaults, etc. For example:: @dispatch.on('y') def doSomething(x,y,z): '''Doc for 'doSomething()' generic function goes here''' @doSomething.when([SomeClass,OtherClass]) def doSomething(x,y,z): # do something when 'isinstance(y,(SomeClass,OtherClass))' @doSomething.when(IFoo) def doSomething(x,y,z): # do something to a 'y' that has been adapted to 'IFoo' """ def callback(frm,name,value,old_locals): return _mkGeneric(value,argument_name) from dispatch.functions import _mkGeneric from peak.util.decorators import decorate_assignment return decorate_assignment(callback) PKҔ6F3dispatch/__init__.pyc; (Ec@sHdZdkTdklZeefZedZdZ dZ dS(sMultiple/Predicate Dispatch Framework This framework refines the algorithms of Chambers and Chen in their 1999 paper, "Efficient Multiple and Predicate Dispatching", to make them suitable for Python, while adding a few other enhancements like incremental index building and lazy expansion of the dispatch DAG. Also, their algorithm was designed only for class selection and true/false tests, while this framework can be used with any kind of test, such as numeric ranges, or custom tests such as categorization/hierarchy membership. NOTE: this package is not yet ready for prime-time. APIs are subject to change randomly without notice. You have been warned! TODO * Support DAG-walking for visualization, debugging, and ambiguity detection (s*(s ClassTypecsdkll}dkl}tjod}n@tt o t |od}nd}||SdS(sUse the following function as the skeleton for a generic function Decorate a Python function so that it wraps an instance of 'dispatch.functions.GenericFunction' that has been configured with the decorated function's name, docstring, argument signature, and default arguments. The decorated function will have additional attributes besides those of a normal function. (See 'dispatch.IGenericFunction' for more information on these special attributes/methods.) Most commonly, you will use the 'when()' method of the decorated function to define "rules" or "methods" of the generic function. For example:: import dispatch @dispatch.generic() def someFunction(*args): '''This is a generic function''' @someFunction.when("len(args)>0") def argsPassed(*args): print "Arguments were passed!" @someFunction.when("len(args)==0") def noArgsPassed(*args): print "No arguments were passed!" someFunction() # prints "No args passed" someFunction(1) # prints "args passed" Note that when using older Python versions, you must use '[dispatch.generic()]' instead of '@dispatch.generic()'. (sGenericFunctionsAbstractGeneric(sdecorate_assignmentcs|iSdS(N(sGenericFunctionsvaluesdelegate(sfrmsnamesvalues old_locals(sGenericFunction(s6build/bdist.darwin-8.9.1-i386/egg/dispatch/__init__.pyscallbackTscs|iSdS(N(scombinersvaluesdelegate(sfrmsnamesvalues old_locals(scombiner(s6build/bdist.darwin-8.9.1-i386/egg/dispatch/__init__.pyscallbackWscs |}|_|iSdS(N(sGenericFunctionsvaluesgfscombinerscombinesdelegate(sfrmsnamesvalues old_localssgf(scombinersGenericFunction(s6build/bdist.darwin-8.9.1-i386/egg/dispatch/__init__.pyscallbackZs  N( sdispatch.functionssGenericFunctionsAbstractGenericspeak.util.decoratorssdecorate_assignmentscombinersNonescallbacks isinstances_clss issubclass(scombinersGenericFunctionscallbacksAbstractGenericsdecorate_assignment((scombinersGenericFunctions6build/bdist.darwin-8.9.1-i386/egg/dispatch/__init__.pysgeneric*s!   csTtdjotind}dkl}||SdS(sUse Python 2.4 decorators w/Python 2.2+ Example: import dispatch class Foo(object): [dispatch.as(classmethod)] def something(cls,etc): """This is a classmethod""" ics%xD]}||}qW|SdS(N(s decoratorssdsv(sframesksvs old_localssd(s decorators(s6build/bdist.darwin-8.9.1-i386/egg/dispatch/__init__.pyscallbackss(sdecorate_assignmentN(slens decoratorsslistsreversescallbackspeak.util.decoratorssdecorate_assignment(s decoratorssdecorate_assignmentscallback((s decoratorss6build/bdist.darwin-8.9.1-i386/egg/dispatch/__init__.pysasbs    cs7d}dkldkl}||SdS(sADecorate the following function as a single-dispatch generic function Single-dispatch generic functions may have a slight speed advantage over predicate-dispatch generic functions when you only need to dispatch based on a single argument's type or protocol, and do not need arbitrary predicates. Also, single-dispatch functions do not require you to adapt the dispatch argument when dispatching based on protocol or interface, and if the dispatch argument has a '__conform__' method, it will attempt to use it, rather than simply dispatching based on class information the way predicate dispatch functions do. The created generic function will use the documentation from the supplied function as its docstring. And, it will dispatch methods based on the argument named by 'argument_name', and otherwise keeping the same argument signature, defaults, etc. For example:: @dispatch.on('y') def doSomething(x,y,z): '''Doc for 'doSomething()' generic function goes here''' @doSomething.when([SomeClass,OtherClass]) def doSomething(x,y,z): # do something when 'isinstance(y,(SomeClass,OtherClass))' @doSomething.when(IFoo) def doSomething(x,y,z): # do something to a 'y' that has been adapted to 'IFoo' cs|SdS(N(s _mkGenericsvalues argument_name(sfrmsnamesvalues old_locals(s _mkGenerics argument_name(s6build/bdist.darwin-8.9.1-i386/egg/dispatch/__init__.pyscallbacks(s _mkGeneric(sdecorate_assignmentN(scallbacksdispatch.functionss _mkGenericspeak.util.decoratorssdecorate_assignment(s argument_names _mkGenericscallbacksdecorate_assignment((s argument_names _mkGenerics6build/bdist.darwin-8.9.1-i386/egg/dispatch/__init__.pyson|s   N( s__doc__sdispatch.interfacesstypess ClassTypes _ClassTypestypes_clssNonesgenericsasson(sonsgenerics _ClassTypesass_cls((s6build/bdist.darwin-8.9.1-i386/egg/dispatch/__init__.pys?s    8 PKҔ6}"wdispatch/_d_speedups.pydef __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, imp __file__ = pkg_resources.resource_filename(__name__,'_d_speedups.so') del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__() PKҔ6t}@@dispatch/_d_speedups.pyc; m7Fc@sdatdS(cCsGdk}dk}dk}|itdabb|ittdS(Ns_d_speedups.so( ssyss pkg_resourcessimpsresource_filenames__name__s__file__s __bootstrap__s __loader__s load_dynamic(s pkg_resourcesssyssimp((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/_d_speedups.pys __bootstrap__s N(s __bootstrap__(((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/_d_speedups.pys?s PKҔ67 XXdispatch/_d_speedups.soH__TEXTpp__text__TEXT >a __picsymbol_stub__TEXTkk__cstring__TEXTkk__textcoal_nt__TEXToo __DATApp__data__DATAptp__dyld__DATAtutu__bss__DATAu\__IMPORT__jump_table__IMPORT__pointers__IMPORTD/8__LINKEDIT 4 C/usr/lib/libgcc_s.1.dylib 4 (FX/usr/lib/libSystem.B.dylibؓc |LS P" " # @|@{X#fkXkUSeED$$wP []UVuV t tFu^]F P$RFu^]UE@ tUT$$U t1UVSNeuV t t]vF 1[^]ËF P$R]vF 1[^]USdED$$vPP P[]UVuVt tdV t tDVt tFu^]FP$RFu^]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DVlcDjtcDnwcD~cDcDcDcD!cD1cDG cDH cD2cD3cD7cD;cD<cDA dDE.dDK0dDL9dDVdDXdDYbdDG hdDH |dDZdD[dD\dD]dD^dD_dD`dDadDbdDcdDdeD&eD3eDEeDTeDieD{eDeDAeDeDeDG eDH eDeDeDeDfD fDfD*fD9fDHfDTfDffDfDfDfDfD3fD<fDfDfDgDgD_gD6gDEgDqcgDrgDsgDtgDugDvgDwgDgDgDhDhDhD(hD0hDI >hD1RhDohD}hDhDhDhDhDhDhDuhDiD"iD0iDI >iDYRiDoiD`iDqiDciDaiDiDiD jD jD jD jD jD jD jD #jD3jDSjDyjDI jDwjDvjDjDjDjF$HbGG 'G9GMG^G@pG@GG@G@G@GGG`H&huxHH@H@HHbH@1HcHcH@YHhdHdH@HeHeH@1H>hHRhH@YH>iIRiI@ IjIjIkI$NkI(!8x I("M(vxRM(wxhM(xM(xM(xM(xM&esM&PsM&uN(x-N(xGN(x_N(xrN(xN(xN(xN(xN(xN&s O& s$O&wVO&w~O&`wO&  O 8 6 F % ` 4 5 W b Z 7 ) = 9 : ] $ __dyld_func_lookupdyld_stub_binding_helper__mh_bundle_header___i686.get_pc_thunk.bx_init_d_speedups_PyArg_ParseTupleAndKeywords_PyBaseObject_Type_PyClass_Type_PyCode_New_PyDict_GetItem_PyDict_New_PyDict_Type_PyErr_Clear_PyErr_ExceptionMatches_PyErr_Fetch_PyErr_Format_PyErr_NormalizeException_PyErr_Occurred_PyErr_Restore_PyErr_SetNone_PyErr_SetObject_PyErr_SetString_PyExc_AssertionError_PyExc_AttributeError_PyExc_IndexError_PyExc_NameError_PyExc_SystemError_PyExc_TypeError_PyExc_ValueError_PyFrame_New_PyImport_AddModule_PyInstance_Type_PyInt_AsLong_PyInt_FromLong_PyIter_Next_PyList_New_PyModule_GetDict_PyObject_CallFunction_PyObject_CallObject_PyObject_Cmp_PyObject_GC_Del_PyObject_GetAttr_PyObject_GetAttrString_PyObject_GetItem_PyObject_GetIter_PyObject_IsInstance_PyObject_IsTrue_PyObject_SetAttr_PyObject_SetAttrString_PyObject_SetItem_PyObject_Size_PyObject_Type_PySequence_GetItem_PySequence_Tuple_PyString_FromString_PyString_FromStringAndSize_PyString_InternFromString_PyString_Type_PyThreadState_Get_PyTraceBack_Here_PyTraceBack_Type_PyTuple_New_PyTuple_Size_PyTuple_Type_PyType_IsSubtype_PyType_Ready_PyType_Type_Py_InitModule4__Py_NoneStruct{standard input}int:t1=r1;-2147483648;2147483647;char:t2=r2;0;127;void:t3=3/SourceCache/Csu/Csu-58/bundle1.s/SourceCache/Csu/Csu-58///SourceCache/Csu/Csu-58/bundle1.s/SourceCache/Csu/Csu-58/bundle1.sdyld_stub_binding_helper:F3dyld__mh_bundle_headerdyld_lazy_symbol_binding_entry_point__dyld_func_lookup:F3dyld_func_lookup_pointer/Users/alberto/src/python/checkouts/RuleDispatch/src/dispatch/_d_speedups.cgcc2_compiled.___pyx_ptype_11_d_speedups_BaseDispatcher___pyx_type_11_d_speedups_BaseDispatcher___pyx_tp_dealloc_11_d_speedups_BaseDispatcher___pyx_tp_as_number_BaseDispatcher___pyx_tp_as_sequence_BaseDispatcher___pyx_tp_as_mapping_BaseDispatcher___pyx_tp_as_buffer_BaseDispatcher___pyx_tp_traverse_11_d_speedups_BaseDispatcher___pyx_tp_clear_11_d_speedups_BaseDispatcher___pyx_methods_11_d_speedups_BaseDispatcher___pyx_tp_new_11_d_speedups_BaseDispatcher___pyx_f_11_d_speedups_14BaseDispatcher___getitem_____pyx_sq_item_11_d_speedups_BaseDispatcher___pyx_ptype_11_d_speedups_ExprCache___pyx_type_11_d_speedups_ExprCache___pyx_tp_dealloc_11_d_speedups_ExprCache___pyx_tp_as_number_ExprCache___pyx_tp_as_sequence_ExprCache___pyx_tp_as_mapping_ExprCache___pyx_tp_as_buffer_ExprCache___pyx_tp_traverse_11_d_speedups_ExprCache___pyx_tp_clear_11_d_speedups_ExprCache___pyx_methods_11_d_speedups_ExprCache___pyx_f_11_d_speedups_9ExprCache___init_____pyx_tp_new_11_d_speedups_ExprCache___pyx_f_11_d_speedups_9ExprCache___getitem_____pyx_sq_item_11_d_speedups_ExprCache___pyx_ptype_11_d_speedups__ExtremeType___pyx_type_11_d_speedups__ExtremeType___pyx_tp_dealloc_11_d_speedups__ExtremeType___pyx_f_11_d_speedups_12_ExtremeType___cmp_____pyx_f_11_d_speedups_12_ExtremeType___repr_____pyx_tp_as_number__ExtremeType___pyx_tp_as_sequence__ExtremeType___pyx_tp_as_mapping__ExtremeType___pyx_f_11_d_speedups_12_ExtremeType___hash_____pyx_tp_as_buffer__ExtremeType___pyx_tp_traverse_11_d_speedups__ExtremeType___pyx_tp_clear_11_d_speedups__ExtremeType___pyx_f_11_d_speedups_12_ExtremeType___richcmp_____pyx_methods_11_d_speedups__ExtremeType___pyx_f_11_d_speedups_12_ExtremeType___init_____pyx_tp_new_11_d_speedups__ExtremeType___pyx_string_tab___pyx_k1p___pyx_k1___pyx_k10p___pyx_k10___pyx_k11p___pyx_k11___pyx_intern_tab___pyx_n_DispatchError___pyx_n_IndexError___pyx_n_InstanceType___pyx_n_KeyError___pyx_n_Max___pyx_n_Min___pyx_n_NoApplicableMethods___pyx_n_TypeError___pyx_n___all_____pyx_n___bases_____pyx_n___class_____pyx_n___getitem_____pyx_n___hash_____pyx_n___nbases___pyx_n__acquire___pyx_n__dispatcher___pyx_n__release___pyx_n__startNode___pyx_n_append___pyx_n_concatenate_ranges___pyx_n_dispatch_by_inequalities___pyx_n_dispatch_by_mro___pyx_n_expr_defs___pyx_n_keys___pyx_n_map___pyx_n_object___pyx_n_reseed___pyx_n_sort___pyx_n_types___pyx_f___pyx_filenames___pyx_mdoc___pyx_methods___pyx_f_11_d_speedups_concatenate_ranges___pyx_f_11_d_speedups_dispatch_by_inequalities___pyx_f_11_d_speedups_dispatch_by_mro___pyx_doc_11_d_speedups_dispatch_by_mro__pyx_tp_new_11_d_speedups__ExtremeType:f(0,1)t:p(0,2)a:p(0,1)k:p(0,1)o:r(0,1)t:r(0,2):t(0,1)=*(0,3):t(0,2)=*(0,4)PyObject:t(0,3)=(0,5)PyTypeObject:t(0,4)=(0,6)_object:T(0,5)=s8ob_refcnt:(0,7),0,32;ob_type:(0,8),32,32;;_typeobject:T(0,6)=s192ob_refcnt:(0,7),0,32;ob_type:(0,8),32,32;ob_size:(0,7),64,32;tp_name:(0,9),96,32;tp_basicsize:(0,7),128,32;tp_itemsize:(0,7),160,32;tp_dealloc:(0,10),192,32;tp_print:(0,12),224,32;tp_getattr:(0,14),256,32;tp_setattr:(0,16),288,32;tp_compare:(0,18),320,32;tp_repr:(0,20),352,32;tp_as_number:(0,22),384,32;tp_as_sequence:(0,23),416,32;tp_as_mapping:(0,24),448,32;tp_hash:(0,25),480,32;tp_call:(0,27),512,32;tp_str:(0,20),544,32;tp_getattro:(0,29),576,32;tp_setattro:(0,31),608,32;tp_as_buffer:(0,33),640,32;tp_flags:(0,34),672,32;tp_doc:(0,9),704,32;tp_traverse:(0,35),736,32;tp_clear:(0,37),768,32;tp_richcompare:(0,39),800,32;tp_weaklistoffset:(0,34),832,32;tp_iter:(0,41),864,32;tp_iternext:(0,42),896,32;tp_methods:(0,43),928,32;tp_members:(0,44),960,32;tp_getset:(0,45),992,32;tp_base:(0,8),1024,32;tp_dict:(0,1),1056,32;tp_descr_get:(0,46),1088,32;tp_descr_set:(0,47),1120,32;tp_dictoffset:(0,34),1152,32;tp_init:(0,48),1184,32;tp_alloc:(0,49),1216,32;tp_new:(0,51),1248,32;tp_free:(0,53),1280,32;tp_is_gc:(0,37),1312,32;tp_bases:(0,1),1344,32;tp_mro:(0,1),1376,32;tp_cache:(0,1),1408,32;tp_subclasses:(0,1),1440,32;tp_weaklist:(0,1),1472,32;tp_del:(0,10),1504,32;;int:t(0,7)=r(0,7);-2147483648;2147483647;:t(0,8)=*(0,6):t(0,9)=*(0,55):t(0,11)=*(0,56)destructor:t(0,10)=(0,11):t(0,13)=*(0,57)printfunc:t(0,12)=(0,13):t(0,15)=*(0,58)getattrfunc:t(0,14)=(0,15):t(0,17)=*(0,59)setattrfunc:t(0,16)=(0,17):t(0,19)=*(0,60)cmpfunc:t(0,18)=(0,19):t(0,21)=*(0,61)reprfunc:t(0,20)=(0,21):t(0,22)=*(0,62):t(0,23)=*(0,63):t(0,24)=*(0,64):t(0,26)=*(0,65)hashfunc:t(0,25)=(0,26):t(0,28)=*(0,66)ternaryfunc:t(0,27)=(0,28):t(0,30)=*(0,67)getattrofunc:t(0,29)=(0,30):t(0,32)=*(0,68)setattrofunc:t(0,31)=(0,32):t(0,33)=*(0,69)long int:t(0,34)=r(0,34);-2147483648;2147483647;:t(0,36)=*(0,70)traverseproc:t(0,35)=(0,36):t(0,38)=*(0,71)inquiry:t(0,37)=(0,38):t(0,40)=*(0,72)richcmpfunc:t(0,39)=(0,40)getiterfunc:t(0,41)=(0,21)iternextfunc:t(0,42)=(0,21):t(0,43)=*(0,73):t(0,44)=*(0,74):t(0,45)=*(0,75)descrgetfunc:t(0,46)=(0,28)descrsetfunc:t(0,47)=(0,32)initproc:t(0,48)=(0,32):t(0,50)=*(0,76)allocfunc:t(0,49)=(0,50):t(0,52)=*(0,77)newfunc:t(0,51)=(0,52):t(0,54)=*(0,78)freefunc:t(0,53)=(0,54)char:t(0,55)=r(0,55);0;127;:t(0,56)=f(0,79):t(0,57)=f(0,7):t(0,58)=f(0,1):t(0,59)=f(0,7):t(0,60)=f(0,7):t(0,61)=f(0,1)PyNumberMethods:t(0,62)=(0,80)PySequenceMethods:t(0,63)=(0,81)PyMappingMethods:t(0,64)=(0,82):t(0,65)=f(0,34):t(0,66)=f(0,1):t(0,67)=f(0,1):t(0,68)=f(0,7)PyBufferProcs:t(0,69)=(0,83):t(0,70)=f(0,7):t(0,71)=f(0,7):t(0,72)=f(0,1)PyMethodDef:T(0,73)=s16ml_name:(0,9),0,32;ml_meth:(0,84),32,32;ml_flags:(0,7),64,32;ml_doc:(0,9),96,32;;PyMemberDef:T(0,74)=s20name:(0,9),0,32;type:(0,7),32,32;offset:(0,7),64,32;flags:(0,7),96,32;doc:(0,9),128,32;;PyGetSetDef:T(0,75)=s20name:(0,9),0,32;get:(0,85),32,32;set:(0,87),64,32;doc:(0,9),96,32;closure:(0,89),128,32;;:t(0,76)=f(0,1):t(0,77)=f(0,1):t(0,78)=f(0,79):t(0,79)=(0,79):T(0,80)=s152nb_add:(0,90),0,32;nb_subtract:(0,90),32,32;nb_multiply:(0,90),64,32;nb_divide:(0,90),96,32;nb_remainder:(0,90),128,32;nb_divmod:(0,90),160,32;nb_power:(0,27),192,32;nb_negative:(0,91),224,32;nb_positive:(0,91),256,32;nb_absolute:(0,91),288,32;nb_nonzero:(0,37),320,32;nb_invert:(0,91),352,32;nb_lshift:(0,90),384,32;nb_rshift:(0,90),416,32;nb_and:(0,90),448,32;nb_xor:(0,90),480,32;nb_or:(0,90),512,32;nb_coerce:(0,92),544,32;nb_int:(0,91),576,32;nb_long:(0,91),608,32;nb_float:(0,91),640,32;nb_oct:(0,91),672,32;nb_hex:(0,91),704,32;nb_inplace_add:(0,90),736,32;nb_inplace_subtract:(0,90),768,32;nb_inplace_multiply:(0,90),800,32;nb_inplace_divide:(0,90),832,32;nb_inplace_remainder:(0,90),864,32;nb_inplace_power:(0,27),896,32;nb_inplace_lshift:(0,90),928,32;nb_inplace_rshift:(0,90),960,32;nb_inplace_and:(0,90),992,32;nb_inplace_xor:(0,90),1024,32;nb_inplace_or:(0,90),1056,32;nb_floor_divide:(0,90),1088,32;nb_true_divide:(0,90),1120,32;nb_inplace_floor_divide:(0,90),1152,32;nb_inplace_true_divide:(0,90),1184,32;;:T(0,81)=s40sq_length:(0,37),0,32;sq_concat:(0,90),32,32;sq_repeat:(0,94),64,32;sq_item:(0,94),96,32;sq_slice:(0,96),128,32;sq_ass_item:(0,98),160,32;sq_ass_slice:(0,100),192,32;sq_contains:(0,102),224,32;sq_inplace_concat:(0,90),256,32;sq_inplace_repeat:(0,94),288,32;;:T(0,82)=s12mp_length:(0,37),0,32;mp_subscript:(0,90),32,32;mp_ass_subscript:(0,103),64,32;;:T(0,83)=s16bf_getreadbuffer:(0,104),0,32;bf_getwritebuffer:(0,106),32,32;bf_getsegcount:(0,107),64,32;bf_getcharbuffer:(0,109),96,32;;PyCFunction:t(0,84)=(0,30):t(0,86)=*(0,111)getter:t(0,85)=(0,86):t(0,88)=*(0,112)setter:t(0,87)=(0,88):t(0,89)=*(0,79)binaryfunc:t(0,90)=(0,30)unaryfunc:t(0,91)=(0,21):t(0,93)=*(0,113)coercion:t(0,92)=(0,93):t(0,95)=*(0,114)intargfunc:t(0,94)=(0,95):t(0,97)=*(0,115)intintargfunc:t(0,96)=(0,97):t(0,99)=*(0,116)intobjargproc:t(0,98)=(0,99):t(0,101)=*(0,117)intintobjargproc:t(0,100)=(0,101)objobjproc:t(0,102)=(0,19)objobjargproc:t(0,103)=(0,32):t(0,105)=*(0,118)getreadbufferproc:t(0,104)=(0,105)getwritebufferproc:t(0,106)=(0,105):t(0,108)=*(0,119)getsegcountproc:t(0,107)=(0,108):t(0,110)=*(0,120)getcharbufferproc:t(0,109)=(0,110):t(0,111)=f(0,1):t(0,112)=f(0,7):t(0,113)=f(0,7):t(0,114)=f(0,1):t(0,115)=f(0,1):t(0,116)=f(0,7):t(0,117)=f(0,7):t(0,118)=f(0,7):t(0,119)=f(0,7):t(0,120)=f(0,7)__pyx_tp_dealloc_11_d_speedups__ExtremeType:f(0,79)o:p(0,1)__pyx_obj_11_d_speedups__ExtremeType:T(0,121)=s16ob_refcnt:(0,7),0,32;ob_type:(0,8),32,32;_cmpr:(0,7),64,32;_rep:(0,1),96,32;;o:r(0,1)__pyx_tp_traverse_11_d_speedups__ExtremeType:f(0,7)o:p(0,1)v:p(0,122)a:p(0,89)e:r(0,7)int:t(0,7):t(0,123)=*(0,124)visitproc:t(0,122)=(0,123):t(0,124)=f(0,7)o:r(0,1)__pyx_tp_clear_11_d_speedups__ExtremeType:f(0,7)o:p(0,1)o:r(0,1)__pyx_tp_new_11_d_speedups_ExprCache:f(0,1)t:p(0,2)a:p(0,1)k:p(0,1)o:r(0,1)__pyx_obj_11_d_speedups_ExprCache:T(0,125)=s20ob_refcnt:(0,7),0,32;ob_type:(0,8),32,32;cache:(0,1),64,32;argtuple:(0,1),96,32;expr_defs:(0,1),128,32;;t:r(0,2)__pyx_tp_dealloc_11_d_speedups_ExprCache:f(0,79)o:p(0,1)o:r(0,1)__pyx_tp_traverse_11_d_speedups_ExprCache:f(0,7)o:p(0,1)v:p(0,122)a:p(0,89)e:r(0,7)o:r(0,1)a:r(0,89)__pyx_tp_clear_11_d_speedups_ExprCache:f(0,7)o:p(0,1)o:r(0,1)__pyx_sq_item_11_d_speedups_ExprCache:f(0,1)o:p(0,1)i:p(0,7)r:r(0,1)x:r(0,1)o:r(0,1)i:r(0,7)__pyx_tp_new_11_d_speedups_BaseDispatcher:f(0,1)t:p(0,2)a:p(0,1)k:p(0,1)t:r(0,2)__pyx_tp_dealloc_11_d_speedups_BaseDispatcher:f(0,79)o:p(0,1)o:r(0,1)__pyx_tp_traverse_11_d_speedups_BaseDispatcher:f(0,7)o:p(0,1)v:p(0,122)a:p(0,89)__pyx_tp_clear_11_d_speedups_BaseDispatcher:f(0,7)o:p(0,1)__pyx_sq_item_11_d_speedups_BaseDispatcher:f(0,1)o:p(0,1)i:p(0,7)r:r(0,1)x:r(0,1)o:r(0,1)i:r(0,7)___Pyx_Import___pyx_b___pyx_m__Pyx_Import:f(0,1)name:p(0,1)from_list:P(0,1)__import__:r(0,1)empty_list:(0,1)module:r(0,1)global_dict:r(0,1)empty_dict:(0,1)list:(0,1)void:t(0,79)___Pyx_Raise__Pyx_Raise:f(0,79)type:P(0,1)value:p(0,1)tb:p(0,1)___Pyx_GetExcValue__Pyx_GetExcValue:f(0,1)type:(0,1)value:(0,1)tb:(0,1)result:r(0,1)tstate:(0,126):t(0,126)=*(0,127)PyThreadState:t(0,127)=(0,128)_ts:T(0,128)=s84next:(0,129),0,32;interp:(0,130),32,32;frame:(0,131),64,32;recursion_depth:(0,7),96,32;tracing:(0,7),128,32;use_tracing:(0,7),160,32;c_profilefunc:(0,132),192,32;c_tracefunc:(0,132),224,32;c_profileobj:(0,1),256,32;c_traceobj:(0,1),288,32;curexc_type:(0,1),320,32;curexc_value:(0,1),352,32;curexc_traceback:(0,1),384,32;exc_type:(0,1),416,32;exc_value:(0,1),448,32;exc_traceback:(0,1),480,32;dict:(0,1),512,32;tick_counter:(0,7),544,32;gilstate_counter:(0,7),576,32;async_exc:(0,1),608,32;thread_id:(0,34),640,32;;:t(0,129)=*(0,128):t(0,130)=*(0,134):t(0,131)=*(0,135):t(0,133)=*(0,136)Py_tracefunc:t(0,132)=(0,133)PyInterpreterState:t(0,134)=(0,137)_frame:T(0,135)=s336ob_refcnt:(0,7),0,32;ob_type:(0,8),32,32;ob_size:(0,7),64,32;f_back:(0,131),96,32;f_code:(0,138),128,32;f_builtins:(0,1),160,32;f_globals:(0,1),192,32;f_locals:(0,1),224,32;f_valuestack:(0,139),256,32;f_stacktop:(0,139),288,32;f_trace:(0,1),320,32;f_exc_type:(0,1),352,32;f_exc_value:(0,1),384,32;f_exc_traceback:(0,1),416,32;f_tstate:(0,126),448,32;f_lasti:(0,7),480,32;f_lineno:(0,7),512,32;f_restricted:(0,7),544,32;f_iblock:(0,7),576,32;f_blockstack:(0,140),608,1920;f_nlocals:(0,7),2528,32;f_ncells:(0,7),2560,32;f_nfreevars:(0,7),2592,32;f_stacksize:(0,7),2624,32;f_localsplus:(0,141),2656,32;;:t(0,136)=f(0,7)_is:T(0,137)=s36next:(0,142),0,32;tstate_head:(0,129),32,32;modules:(0,1),64,32;sysdict:(0,1),96,32;builtins:(0,1),128,32;codec_search_path:(0,1),160,32;codec_search_cache:(0,1),192,32;codec_error_registry:(0,1),224,32;dlopenflags:(0,7),256,32;;:t(0,138)=*(0,143):t(0,139)=*(0,1):t(0,140)=ar(0,144);0;19;(0,145):t(0,141)=ar(0,144);0;0;(0,1):t(0,142)=*(0,137)PyCodeObject:t(0,143)=(0,146)long unsigned int:t(0,144)=r(0,144);0;037777777777;PyTryBlock:t(0,145)=(0,147):T(0,146)=s64ob_refcnt:(0,7),0,32;ob_type:(0,8),32,32;co_argcount:(0,7),64,32;co_nlocals:(0,7),96,32;co_stacksize:(0,7),128,32;co_flags:(0,7),160,32;co_code:(0,1),192,32;co_consts:(0,1),224,32;co_names:(0,1),256,32;co_varnames:(0,1),288,32;co_freevars:(0,1),320,32;co_cellvars:(0,1),352,32;co_filename:(0,1),384,32;co_name:(0,1),416,32;co_firstlineno:(0,7),448,32;co_lnotab:(0,1),480,32;;:T(0,147)=s12b_type:(0,7),0,32;b_handler:(0,7),32,32;b_level:(0,7),64,32;;___Pyx_AddTraceback___pyx_filename___pyx_lineno__Pyx_AddTraceback:f(0,79)funcname:P(0,9)py_srcfile:(0,1)py_funcname:r(0,1)py_globals:(0,1)empty_tuple:r(0,1)empty_string:(0,1)py_code:(0,138)py_frame:(0,148):t(0,148)=*(0,149)PyFrameObject:t(0,149)=(0,135)___pyx_v_11_d_speedups_InstanceType___pyx_v_11_d_speedups_NoApplicableMethods___pyx_v_11_d_speedups_DispatchError___pyx_v_11_d_speedups__NF___pyx_v_11_d_speedups___nclassinit_d_speedups:F(0,79)__pyx_1:r(0,1)__pyx_2:r(0,1)__pyx_3:(0,1)__pyx_4:r(0,1)t:r(0,150)t:r(0,151)t:r(0,151)t:r(0,150):t(0,150)=*(0,152):t(0,151)=*(0,153)__Pyx_InternTabEntry:t(0,152)=(0,154)__Pyx_StringTabEntry:t(0,153)=(0,155):T(0,154)=s8p:(0,139),0,32;s:(0,9),32,32;;:T(0,155)=s12p:(0,139),0,32;s:(0,9),32,32;n:(0,34),64,32;;___pyx_argnames.7069__pyx_f_11_d_speedups_12_ExtremeType___init__:f(0,7)__pyx_v_self:p(0,1)__pyx_args:p(0,1)__pyx_kwds:p(0,1)__pyx_v_cmpr:(0,1)__pyx_v_rep:(0,1)__pyx_r:r(0,7)__pyx_argnames:V(0,156):t(0,156)=ar(0,144);0;2;(0,9)__pyx_v_self:r(0,1)__pyx_args:r(0,1)__pyx_kwds:r(0,1)__pyx_f_11_d_speedups_12_ExtremeType___richcmp__:f(0,1)__pyx_v_self:p(0,1)__pyx_v_other:p(0,1)__pyx_v_op:p(0,7)__pyx_v_cmp:(0,1)__pyx_r:r(0,1)__pyx_1:(0,7)__pyx_2:r(0,1)__pyx_3:r(0,1)type:r(0,2)type:r(0,2)type:r(0,2)__pyx_f_11_d_speedups_12_ExtremeType___repr__:f(0,1)__pyx_v_self:p(0,1)__pyx_r:r(0,1)__pyx_v_self:r(0,1)__pyx_f_11_d_speedups_12_ExtremeType___cmp__:f(0,7)__pyx_v_self:p(0,1)__pyx_v_other:p(0,1)__pyx_r:r(0,7)__pyx_2:r(0,1)__pyx_3:r(0,1)___pyx_argnames.7687__pyx_f_11_d_speedups_9ExprCache___init__:f(0,7)__pyx_v_self:p(0,1)__pyx_args:p(0,1)__pyx_kwds:p(0,1)__pyx_v_argtuple:(0,1)__pyx_v_expr_defs:(0,1)__pyx_r:r(0,7)__pyx_1:r(0,1)__pyx_argnames:V(0,157):t(0,157)=ar(0,144);0;2;(0,9)__pyx_v_self:r(0,1)__pyx_args:r(0,1)__pyx_kwds:r(0,1)__pyx_f_11_d_speedups_14BaseDispatcher___getitem__:f(0,1)__pyx_v_self:p(0,1)__pyx_v_argtuple:p(0,1)__pyx_v_node:(0,1)__pyx_v_factory:(0,1)__pyx_v_func:(0,1)__pyx_v_cache:(0,1)__pyx_r:r(0,1)__pyx_1:(0,7)__pyx_2:(0,1)__pyx_3:(0,1)__pyx_4:(0,1)__pyx_5:r(0,1)__pyx_6:(0,1)__pyx_7:(0,1)__pyx_8:r(0,7)__pyx_9:(0,7)__pyx_10:r(0,7)__pyx_why:r(0,7)__pyx_why:r(0,7)__pyx_why:r(0,7)__pyx_why:r(0,7)__pyx_why:r(0,7)__pyx_why:r(0,7)__pyx_why:r(0,7)__pyx_why:r(0,7)__pyx_why:r(0,7)__pyx_why:r(0,7)__pyx_why:r(0,7)__pyx_why:r(0,7)__pyx_why:r(0,7)__pyx_why:r(0,7)__pyx_why:r(0,7)__pyx_why:r(0,7)__pyx_why:r(0,7)__pyx_why:r(0,7)__pyx_why:r(0,7)__pyx_f_11_d_speedups_9ExprCache___getitem__:f(0,1)__pyx_v_self:p(0,1)__pyx_v_item:p(0,1)__pyx_v_f:(0,1)__pyx_v_args:(0,1)__pyx_r:r(0,1)__pyx_1:r(0,1)__pyx_2:(0,7)__pyx_3:(0,1)__pyx_4:r(0,1)name:(0,1)name:(0,1)name:r(0,1)item:r(0,1)name:r(0,1)item:r(0,1)item:r(0,1)name:r(0,1)name:r(0,1)__pyx_f_11_d_speedups_12_ExtremeType___hash__:f(0,34)__pyx_v_self:p(0,1)__pyx_r:r(0,34)long int:t(0,34)__pyx_1:r(0,1)__pyx_2:r(0,1)__pyx_3:(0,1)__pyx_4:r(0,34)name:r(0,1)name:r(0,1)___pyx_argnames.7319__pyx_f_11_d_speedups_concatenate_ranges:f(0,1)__pyx_self:p(0,1)__pyx_args:p(0,1)__pyx_kwds:p(0,1)__pyx_v_range_map:(0,1)__pyx_v_ranges:(0,1)__pyx_v_output:(0,1)__pyx_v_last:(0,1)__pyx_v_l:r(0,1)__pyx_v_h:(0,1)__pyx_r:r(0,1)__pyx_1:(0,1)__pyx_2:r(0,1)__pyx_3:(0,1)__pyx_4:(0,1)__pyx_5:(0,7)__pyx_argnames:V(0,158):t(0,158)=ar(0,144);0;1;(0,9)__pyx_args:r(0,1)__pyx_kwds:r(0,1)name:r(0,1)item:r(0,1)name:r(0,1)item:r(0,1)item:r(0,1)___pyx_argnames.7433__pyx_f_11_d_speedups_dispatch_by_inequalities:f(0,1)__pyx_self:p(0,1)__pyx_args:p(0,1)__pyx_kwds:p(0,1)__pyx_v_table:(0,1)__pyx_v_ob:(0,1)__pyx_v_lo:(0,7)__pyx_v_hi:(0,7)__pyx_v_key:r(0,1)__pyx_v_ranges:(0,1)__pyx_v_t:(0,1)__pyx_r:(0,1)__pyx_1:(0,1)__pyx_2:(0,7)__pyx_3:r(0,1)__pyx_4:(0,1)__pyx_argnames:V(0,159):t(0,159)=ar(0,144);0;2;(0,9)__pyx_args:r(0,1)__pyx_kwds:r(0,1)name:r(0,1)name:r(0,1)___pyx_argnames.7549__pyx_f_11_d_speedups_dispatch_by_mro:f(0,1)__pyx_self:p(0,1)__pyx_args:p(0,1)__pyx_kwds:p(0,1)__pyx_v_table:(0,1)__pyx_v_ob:(0,1)__pyx_v_bc:r(0,7)__pyx_v_bases:r(0,160)__pyx_v_klass:(0,1)__pyx_v_err:r(0,1)__pyx_r:r(0,1)__pyx_1:r(0,7):t(0,160)=*(0,161)PyTupleObject:t(0,161)=(0,162):T(0,162)=s16ob_refcnt:(0,7),0,32;ob_type:(0,8),32,32;ob_size:(0,7),64,32;ob_item:(0,141),96,32;;__pyx_argnames:V(0,163):t(0,163)=ar(0,144);0;2;(0,9)__pyx_args:r(0,1)__pyx_kwds:r(0,1)name:r(0,1)name:r(0,1)name:r(0,1)name:r(0,1)name:r(0,1)name:r(0,1)__pyx_m:S(0,1)__pyx_b:S(0,1)__pyx_lineno:S(0,7)__pyx_filename:S(0,9)char:t(0,55)__pyx_f:S(0,164):t(0,164)=*(0,9)__pyx_mdoc:S(0,165)__pyx_type_11_d_speedups__ExtremeType:S(0,4)__pyx_type_11_d_speedups_ExprCache:S(0,4)__pyx_type_11_d_speedups_BaseDispatcher:S(0,4)__pyx_ptype_11_d_speedups__ExtremeType:S(0,2)__pyx_ptype_11_d_speedups_ExprCache:S(0,2)__pyx_ptype_11_d_speedups_BaseDispatcher:S(0,2)__pyx_v_11_d_speedups_InstanceType:S(0,1)__pyx_v_11_d_speedups_NoApplicableMethods:S(0,1)__pyx_v_11_d_speedups_DispatchError:S(0,1)__pyx_v_11_d_speedups__NF:S(0,1)__pyx_v_11_d_speedups___nclass:S(0,1)__pyx_k1:S(0,166)__pyx_n___all__:S(0,1)__pyx_n___nbases:S(0,1)__pyx_n_Max:S(0,1)__pyx_n_Min:S(0,1)__pyx_n_concatenate_ranges:S(0,1)__pyx_n_dispatch_by_inequalities:S(0,1)__pyx_n_dispatch_by_mro:S(0,1)__pyx_n_NoApplicableMethods:S(0,1)__pyx_n_DispatchError:S(0,1)__pyx_n_types:S(0,1)__pyx_n_InstanceType:S(0,1)__pyx_n___class__:S(0,1)__pyx_n___bases__:S(0,1)__pyx_k1p:S(0,1)__pyx_n_object:S(0,1)__pyx_n___hash__:S(0,1)__pyx_n_keys:S(0,1)__pyx_n_sort:S(0,1)__pyx_n_append:S(0,1)__pyx_n_TypeError:S(0,1)__pyx_n_reseed:S(0,1)__pyx_k10p:S(0,1)__pyx_k11p:S(0,1)__pyx_k10:S(0,167)__pyx_k11:S(0,168)__pyx_doc_11_d_speedups_dispatch_by_mro:S(0,169)__pyx_n___getitem__:S(0,1)__pyx_n_IndexError:S(0,1)__pyx_n_KeyError:S(0,1)__pyx_n_map:S(0,1)__pyx_n__dispatcher:S(0,1)__pyx_n__startNode:S(0,1)__pyx_n__acquire:S(0,1)__pyx_n__release:S(0,1)__pyx_n_expr_defs:S(0,1)__pyx_intern_tab:S(0,170)__pyx_string_tab:S(0,171)__pyx_methods_11_d_speedups__ExtremeType:S(0,172)__pyx_tp_as_number__ExtremeType:S(0,62)__pyx_tp_as_sequence__ExtremeType:S(0,63)__pyx_tp_as_mapping__ExtremeType:S(0,64)__pyx_tp_as_buffer__ExtremeType:S(0,69)__pyx_methods_11_d_speedups_ExprCache:S(0,173)__pyx_tp_as_number_ExprCache:S(0,62)__pyx_tp_as_sequence_ExprCache:S(0,63)__pyx_tp_as_mapping_ExprCache:S(0,64)__pyx_tp_as_buffer_ExprCache:S(0,69)__pyx_methods_11_d_speedups_BaseDispatcher:S(0,174)__pyx_tp_as_number_BaseDispatcher:S(0,62)__pyx_tp_as_sequence_BaseDispatcher:S(0,63)__pyx_tp_as_mapping_BaseDispatcher:S(0,64)__pyx_tp_as_buffer_BaseDispatcher:S(0,69)__pyx_methods:S(0,175)__pyx_filenames:S(0,176):t(0,165)=ar(0,144);0;39;(0,55):t(0,166)=ar(0,144);0;19;(0,55):t(0,167)=ar(0,144);0;19;(0,55):t(0,168)=ar(0,144);0;20;(0,55):t(0,169)=ar(0,144);0;57;(0,55):t(0,170)=ar(0,144);0;29;(0,152):t(0,171)=ar(0,144);0;3;(0,153):t(0,172)=ar(0,144);0;0;(0,73):t(0,173)=ar(0,144);0;0;(0,73):t(0,174)=ar(0,144);0;0;(0,73):t(0,175)=ar(0,144);0;3;(0,73):t(0,176)=ar(0,144);0;0;(0,9)PK5y6I$$dispatch/ast_builder.pyfrom token import tok_name, NAME, NUMBER, STRING, ISNONTERMINAL from symbol import sym_name from new import instancemethod import token, symbol, parser, sys __all__ = [ 'parse_expr', 'build' ] _name = lambda builder,nodelist: builder.Name(nodelist[1]) _const = lambda builder,nodelist: builder.Const(eval(nodelist[1])) production = { NAME: _name, NUMBER: _const, STRING: _const, } ops = { token.LEFTSHIFT: 'LeftShift', token.RIGHTSHIFT: 'RightShift', token.PLUS: 'Add', token.MINUS: 'Sub', token.STAR: 'Mul', token.SLASH: 'Div', token.PERCENT: 'Mod', token.DOUBLESLASH: 'FloorDiv', } def left_assoc(builder, nodelist): return getattr(builder,ops[nodelist[-2][0]])(nodelist[:-2],nodelist[-1]) def curry(f,*args): for arg in args: f = instancemethod(f,arg,type(arg)) return f def com_binary(opname, builder,nodelist): "Compile 'NODE (OP NODE)*' into (type, [ node1, ..., nodeN ])." items = [nodelist[i] for i in range(1,len(nodelist),2)] return getattr(builder,opname)(items) # testlist: test (',' test)* [','] # subscriptlist: subscript (',' subscript)* [','] testlist = subscriptlist = curry(com_binary, 'Tuple') # testlist_gexp test (gen_for | (',' test)* [',']) testlist_gexp = testlist # XXX # test: and_test ('or' and_test)* | lambdef test = curry(com_binary, 'Or') if sys.version>='2.5': or_test = test # test: or_test ['if' or_test 'else' test] | lambdef def test(builder, nodelist): return builder.IfElse(nodelist[1], nodelist[3], nodelist[5]) # and_test: not_test ('and' not_test)* and_test = curry(com_binary, 'And') # not_test: 'not' not_test | comparison def not_test(builder, nodelist): return builder.Not(nodelist[2]) # comparison: expr (comp_op expr)* def comparison(builder, nodelist): if len(nodelist)>4 and builder.simplify_comparisons: # Reduce (x < y < z ...) to (x' | '>=' | '<=' | '<>' | '!=' | '==' # | 'in' | 'not' 'in' | 'is' | 'is' 'not' n = nl[1] if n[0] == token.NAME: type = n[1] if len(nl) == 3: if type == 'not': type = 'not in' else: type = 'is not' else: type = n[1] results.append((type, nodelist[i])) return builder.Compare(nodelist[1], results) # expr: xor_expr ('|' xor_expr)* expr = curry(com_binary, 'Bitor') # xor_expr: and_expr ('^' and_expr)* xor_expr = curry(com_binary, 'Bitxor') # and_expr: shift_expr ('&' shift_expr)* and_expr = curry(com_binary, 'Bitand') # shift_expr: arith_expr ('<<'|'>>' arith_expr)* # arith_expr: term (('+'|'-') term)* # term: factor (('*'|'/'|'%'|'//') factor)* shift_expr = arith_expr = term = left_assoc unary_ops = { token.PLUS: 'UnaryPlus', token.MINUS: 'UnaryMinus', token.TILDE: 'Invert', } # factor: ('+'|'-'|'~') factor | power def factor(builder, nodelist): return getattr(builder,unary_ops[nodelist[1][0]])(nodelist[2]) # power: atom trailer* ['**' factor] def power(builder, nodelist): if nodelist[-2][0]==token.DOUBLESTAR: return builder.Power(nodelist[:-2], nodelist[-1]) node = nodelist[-1] nodelist = nodelist[:-1] t = node[1][0] # trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME if t == token.LPAR: return com_call_function(builder,nodelist,node[2]) elif t == token.DOT: return builder.Getattr(nodelist, node[2][1]) elif t == token.LSQB: item = node[2] while len(item)==2: item = item[1] if item[0]==token.COLON: lineno = item[2] return builder.Subscript(nodelist, (symbol.subscript, (token.STRING,`0`,lineno), item, (token.STRING,`sys.maxint`,lineno) ) ) return builder.Subscript(nodelist, item) raise AssertionError("Unknown power", nodelist) # atom: '(' [testlist_gexp] ')' | # '[' [listmaker] ']' | # '{' [dictmaker] '}' | # '`' testlist1 '`' | # NAME | NUMBER | STRING+ def atom(builder, nodelist): t = nodelist[1][0] if t == token.LPAR: if nodelist[2][0] == token.RPAR: return builder.Tuple(()) return build(builder,nodelist[2]) elif t==token.LSQB: if nodelist[2][0] == token.RSQB: return builder.List(()) return listmaker(builder,nodelist[2]) elif t==token.LBRACE: if nodelist[2][0] == token.RBRACE: items = () else: dm = nodelist[2] items = [(dm[i],dm[i+2]) for i in range(1,len(dm),4)] return builder.Dict(items) elif t==token.BACKQUOTE: return builder.Backquote(nodelist[2]) elif t==token.STRING: return builder.Const(eval(' '.join([n[1] for n in nodelist[1:]]))) raise AssertionError("Unknown atom", nodelist) # arglist: (argument ',')* (argument [',']| '*' test [',' '**' test] | '**' test) def com_call_function(builder, primaryNode, nodelist): if nodelist[0] == token.RPAR: return builder.CallFunc(primaryNode,(),(),None,None) args = []; kw = [] len_nodelist = len(nodelist) for i in range(1, len_nodelist, 2): node = nodelist[i] if node[0] == token.STAR or node[0] == token.DOUBLESTAR: break iskw, result = com_argument(node, kw) if iskw: kw.append(result) else: args.append(result) else: # No broken by star arg, so skip the last one we processed. i = i + 1 if i < len_nodelist and nodelist[i][0] == token.COMMA: # need to accept an application that looks like "f(a, b,)" i = i + 1 star_node = dstar_node = None while i < len_nodelist: tok = nodelist[i] ch = nodelist[i+1] i = i + 3 if tok[0]==token.STAR: star_node = ch elif tok[0]==token.DOUBLESTAR: dstar_node = ch else: raise AssertionError, 'unknown node type: %s' % (tok,) return builder.CallFunc(primaryNode, args, kw, star_node, dstar_node) # argument: [test '='] test [gen_for] (Really [keyword '='] test) def com_argument(nodelist, kw): # XXX Python 2.4 needs genexp handling here if len(nodelist) == 2: if kw: raise SyntaxError, "non-keyword arg after keyword arg" return 0, nodelist[1] n = nodelist[1] while len(n) == 2 and n[0] != token.NAME: n = n[1] if n[0] != token.NAME: raise SyntaxError, "keyword can't be an expression (%r)" % (n,) return 1, ((token.STRING,`n[1]`,n[2]), nodelist[3]) # listmaker: test ( list_for | (',' test)* [','] ) def listmaker(builder, nodelist): values = [] for i in range(1, len(nodelist)): #if nodelist[i][0] == symbol.list_for: # assert len(nodelist[i:]) == 1 # return com_list_comprehension(builder,values[0],nodelist[i]) if nodelist[i][0] == token.COMMA: continue values.append(nodelist[i]) return builder.List(values) # subscript: '.' '.' '.' | test | [test] ':' [test] [sliceop] # sliceop: ':' [test] def subscript(builder, nodelist): if nodelist[1][0]==token.DOT: return builder.Const(Ellipsis) item = nodelist; nl = len(nodelist) while type(item[1]) is tuple: item=item[1] # find token, to get a line# lineno = item[-1] have_stride = nodelist[-1][0]==symbol.sliceop if have_stride: start = stop = stride = (token.STRING, 'None', lineno) if len(nodelist[-1])==3: stride = nodelist[-1][2] else: start = (token.NUMBER,`0`,lineno) stop = (token.NUMBER,`sys.maxint`,lineno) if nl==5: start,stop = nodelist[1],nodelist[3] # test : test sliceop elif nl==4: if nodelist[1][0]==token.COLON: # : test sliceop stop = nodelist[2] elif have_stride: # test : sliceop start = nodelist[1] else: start, stop = nodelist[1], nodelist[3] # test : test elif nl==3: if nodelist[1][0]==token.COLON: if not have_stride: stop = nodelist[2] # : test else: start = nodelist[1] # test : else: raise AssertionError("Unrecognized subscript", nodelist) if have_stride: return builder.Sliceobj(start,stop,stride) return builder.Slice(start,stop) for sym,name in sym_name.items(): if name in globals(): production[sym] = globals()[name] def build(builder, nodelist): while len(nodelist)==2: nodelist = nodelist[1] return production[nodelist[0]](builder,nodelist) def parse_expr(expr,builder): # include line numbers in parse data so valid symbols are never of length 2 return build(builder, parser.expr(expr).totuple(1)[1]) PKҔ6L++dispatch/ast_builder.pyc;  *Fc@sdklZlZlZlZlZdklZdkl Z dkZdkZdk Z dk Z ddgZ dZ dZhee <ee<ee scCs|it|dS(Ni(sbuildersConstsevalsnodelist(sbuildersnodelist((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/ast_builder.pys ss LeftShifts RightShiftsAddsSubsMulsDivsModsFloorDivcCs.t|t|dd|d |dSdS(Niii(sgetattrsbuildersopssnodelist(sbuildersnodelist((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/ast_builder.pys left_assoc scGs1x&|D]}t||t|}qW|SdS(N(sargssargsinstancemethodsfstype(sfsargssarg((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/ast_builder.pyscurry*scCsTgi}tdt|dD]}|||q ~}t|||SdS(s=Compile 'NODE (OP NODE)*' into (type, [ node1, ..., nodeN ]).iiN( sappends_[1]srangeslensnodelistsisitemssgetattrsbuildersopname(sopnamesbuildersnodelistsisitemss_[1]((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/ast_builder.pys com_binary0s=sTuplesOrs2.5cCs#|i|d|d|dSdS(Niii(sbuildersIfElsesnodelist(sbuildersnodelist((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/ast_builder.pystestCssAndcCs|i|dSdS(Ni(sbuildersNotsnodelist(sbuildersnodelist((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/ast_builder.pysnot_testLsc CsHt|djo|io[|igi}tdt|ddD]#}||d |||d!qG~Sng}xtdt|dD]}||d}|d}|dt i joB|d}t|djo!|djo d}qd}qn |d}|i|||fqW|i|d|SdS( Niiiiisnotsnot insis not(slensnodelistsbuilderssimplify_comparisonssAndsappends_[1]srangesisresultssnlsnstokensNAMEstypesCompare(sbuildersnodelistsisresultssns_[1]snlstype((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/ast_builder.pys comparisonTs [     sBitorsBitxorsBitands UnaryPluss UnaryMinussInvertcCs't|t|dd|dSdS(Niii(sgetattrsbuilders unary_opssnodelist(sbuildersnodelist((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/ast_builder.pysfactorscCsn|ddtijo|i|d |dSn|d}|d }|dd}|tijot|||dSn|ti jo|i ||ddSn|ti jo|d}x"t |djo|d}qW|dtijoJ|d}|i|titid |f|titi |ffSn|i||Sntd|dS(Niiiiis Unknown power(snodeliststokens DOUBLESTARsbuildersPowersnodestsLPARscom_call_functionsDOTsGetattrsLSQBsitemslensCOLONslinenos Subscriptssymbols subscriptsSTRINGssyssmaxintsAssertionError(sbuildersnodelistsnodesitemstslineno((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/ast_builder.pyspowers(     7cCs|dd}|tijo>|ddtijo|ifSnt||dSne|tijo>|ddti jo|i fSnt ||dSn|ti jo|ddti jo f}nV|d}gi}tdt|dD]"}|||||dfq~}|i|Sn|tijo|i|dSnZ|tijoI|itdigi}|dD]}||dq~Sntd|dS(Niiiis s Unknown atom(snodelistststokensLPARsRPARsbuildersTuplesbuildsLSQBsRSQBsLists listmakersLBRACEsRBRACEsitemssdmsappends_[1]srangeslensisDicts BACKQUOTEs BackquotesSTRINGsConstsevalsjoinsnsAssertionError(sbuildersnodelistsdmsisitemssns_[1]st((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/ast_builder.pysatoms(  KIcCs|dtijo|i|ffttSng}g} t |}xt d|dD]w}||}|dtijp|dtijoPnt|| \} } | o| i| q\|i| q\W|d}||jo||dtijo|d}nt} }x||jor||} ||d}|d}| dtijo |} q!| dtijo |}q!td| fq!W|i||| | |SdS(Niiiisunknown node type: %s(snodeliststokensRPARsbuildersCallFuncs primaryNodesNonesargsskwslens len_nodelistsrangesisnodesSTARs DOUBLESTARs com_argumentsiskwsresultsappendsCOMMAs star_nodes dstar_nodestokschsAssertionError(sbuilders primaryNodesnodelistsnodeschs len_nodelists dstar_nodesargssiskwsresultsiskws star_nodestok((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/ast_builder.pyscom_call_functions8   ( %      cCst|djo&|o tdnd|dfSn|d}x6t|djo|dtijo|d}qFW|dtijotd|fndti|d |df|dffSdS(Nis!non-keyword arg after keyword argiis#keyword can't be an expression (%r)i(slensnodelistskws SyntaxErrorsnstokensNAMEsSTRING(snodelistskwsn((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/ast_builder.pys com_argument"s  'cCsgg}xMtdt|D]6}||dtijoqn|i||qW|i |SdS(Nii( svaluessrangeslensnodelistsistokensCOMMAsappendsbuildersList(sbuildersnodelistsisvalues((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/ast_builder.pys listmaker6sc Cs|ddtijo|itSn|}t|}x&t |dt jo|d}q>W|d}|ddt i j}|oGtid|f}}}t|ddjo|dd}qn*tid |f}titi |f}|djo|d|df\}}n|djoY|ddtijo|d}q|o|d}q|d|df\}}n]|djo@|ddtijo| o|d}qq|d}ntd ||o|i|||Sn|i||SdS( NiiisNoneiiiisUnrecognized subscript(snodeliststokensDOTsbuildersConstsEllipsissitemslensnlstypestupleslinenossymbolssliceops have_stridesSTRINGsstartsstopsstridesNUMBERssyssmaxintsCOLONsAssertionErrorsSliceobjsSlice( sbuildersnodelists have_stridesnlsstartsstopsitemsstrideslineno((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/ast_builder.pys subscriptLs>    cCs>x"t|djo|d}qWt|d||SdS(Niii(slensnodelists productionsbuilder(sbuildersnodelist((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/ast_builder.pysbuildwscCs't|ti|iddSdS(Ni(sbuildsbuildersparsersexprstotuple(sexprsbuilder((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/ast_builder.pys parse_expr}s(:stokenstok_namesNAMEsNUMBERsSTRINGs ISNONTERMINALssymbolssym_namesnewsinstancemethodsparserssyss__all__s_names_consts productions LEFTSHIFTs RIGHTSHIFTsPLUSsMINUSsSTARsSLASHsPERCENTs DOUBLESLASHsopss left_assocscurrys com_binarystestlists subscriptlists testlist_gexpstestsversionsor_testsand_testsnot_tests comparisonsexprsxor_exprsand_exprs shift_exprs arith_exprstermsTILDEs unary_opssfactorspowersatomscom_call_functions com_arguments listmakers subscriptsitemsssymsnamesglobalssbuilds parse_expr(-s parse_exprsparsersNUMBERs com_binaryssyssnot_tests listmakersatomsxor_exprs__all__s shift_exprs testlist_gexpssym_names_consts productionsbuildsfactorstests subscripts subscriptlistsand_exprscom_call_functionsSTRINGspowersopsssymbolstestlistsand_testsinstancemethodssyms unary_opss comparisonsnames ISNONTERMINALstermsNAMEs arith_exprs com_argumentstok_names left_assocsor_tests_namestokensexprscurry((s9build/bdist.darwin-8.9.1-i386/egg/dispatch/ast_builder.pys?sL%  $   !f     *  - % )   &  PK&5L`dispatch/combiners.py"""Method combining subclasses of Dispatcher and GenericFunction""" from strategy import ordered_signatures from interfaces import AmbiguousMethod from functions import Dispatcher class MapDispatcher(Dispatcher): """Abstract base class for method combiners that merge metadata To use this class, subclass it and override the 'getItems()' method (and optionally the 'shouldStop()' method to support your particular kind of metadata. Then use the subclass as a method combiner for a dispatcher or generic function. See 'combiners.txt' for sample code. """ def getItems(self,signature,method): """Return an iterable of '(key,value)' pairs for given rule""" raise NotImplementedError def shouldStop(self,signature,method): """Return truth if combining should stop at this precedence level""" def combine(self,items): """Build a dictionary from a sequence of '(signature,method)' pairs""" d = {} should_stop = False for level in ordered_signatures(items): current = {} for item in level: should_stop = should_stop or self.shouldStop(*item) for k,v in self.getItems(*item): if k in d: # already defined continue if k in current and current[k]<>v: return AmbiguousMethod(k,v,current[k]) current[k] = v d.update(current) if should_stop: break return d PKҔ6Jʚ{ { dispatch/combiners.pyc; ZDc@sGdZdklZdklZdklZdefdYZdS(s=Method combining subclasses of Dispatcher and GenericFunction(sordered_signatures(sAmbiguousMethod(s Dispatchers MapDispatchercBs)tZdZdZdZdZRS(seAbstract base class for method combiners that merge metadata To use this class, subclass it and override the 'getItems()' method (and optionally the 'shouldStop()' method to support your particular kind of metadata. Then use the subclass as a method combiner for a dispatcher or generic function. See 'combiners.txt' for sample code. cCs tdS(s8Return an iterable of '(key,value)' pairs for given ruleN(sNotImplementedError(sselfs signaturesmethod((s7build/bdist.darwin-8.9.1-i386/egg/dispatch/combiners.pysgetItemsscCsdS(s>Return truth if combining should stop at this precedence levelN((sselfs signaturesmethod((s7build/bdist.darwin-8.9.1-i386/egg/dispatch/combiners.pys shouldStopsc Csh}t}xt|D]}h}x|D]}|p |i |}xq|i |D]`\}}||joqXn||jo|||jot ||||Sn|||>> import dispatch >>> from dispatch import strategy, functions, combiners, NoApplicableMethods .. contents:: **Table of Contents** -------------------------- The "Standard" Combination -------------------------- The default ``Dispatcher`` class only supports returning the most-specific value, or raising ``NoApplicableMethods`` or ``AmbiguousMethod`` errors. But, the default ``GenericFunction`` class implements a result combination strategy similar to the "standard method combination" for generic functions in the Common Lisp Object System (CLOS). Specifically, it supports methods calling the "next method", and it supports "before", "after", and "around" methods, in an ordering similar to that of CLOS. Let's go over each of these concepts in turn. But as we do, please keep in mind that because of PyProtocols' "logical implication" approach to method ordering, before/after/around methods should be needed less often than they would be in CLOS. So, make sure you actually need a particular feature before making your code more complicated than it needs to be. Using ``next_method`` ===================== By default, a ``GenericFunction`` will only invoke the most-specific applicable method. However, if you add a ``next_method`` argument to the beginning of an individual method's signature, you can use it to call the "next method" that applies. That is, the second-most-specific method. If that method also has a ``next_method`` argument, it too will be able to invoke the next method after it, and so on, down through all the applicable methods. For example:: >>> class NextMethodExample: ... [dispatch.generic()] ... def foo(self,bar,baz): ... """Foo bar and baz""" ... ... [foo.when("bar>1 and baz=='spam'")] ... def foo_one_spam(next_method, self, bar, baz): ... return bar + next_method(self,bar,baz) ... ... [foo.when("baz=='spam'")] ... def foo_spam(self, bar, baz): ... return 42 ... ... [foo.when("baz=='blue'")] ... def foo_spam(next_method, self, bar, baz): ... ... # if next_method is an instance of DispatchError, it means ... # that calling it will raise that error (NoApplicableMethods ... # or AmbiguousMethod) ... assert isinstance(next_method, dispatch.DispatchError) ... ... # but we'll call it anyway, just to demo the error ... return 22 + next_method(self,bar,baz) >>> NextMethodExample().foo(2,"spam") # 2 + 42 44 >>> NextMethodExample().foo(2,"blue") # 22 + ...no next method! Traceback (most recent call last): File ... combiners.txt... in foo_spam return 22 + next_method(self,bar,baz) ... NoApplicableMethods: ... Notice that ``next_method`` comes *before* ``self`` in the arguments if the generic function is an instance method. (If used, it must be the *very first* argument of the meth