Drop support for Python classic classes
There were only needed to support Python < 2.2, and we now require at least Python 2.6. Conflicts: .travis.yml Examples/test-suite/python/autodoc_runme.py Source/Modules/python.cxx This is a cherry-pick and merge from patch in #1261
This commit is contained in:
parent
dcbccc6f6f
commit
728b8955bd
20 changed files with 96 additions and 241 deletions
|
|
@ -1,9 +1,6 @@
|
|||
from global_namespace import *
|
||||
|
||||
|
||||
def is_new_style_class(cls):
|
||||
return hasattr(cls, "__class__")
|
||||
|
||||
k1 = Klass1()
|
||||
k2 = Klass2()
|
||||
k3 = Klass3()
|
||||
|
|
@ -12,12 +9,8 @@ k5 = Klass5()
|
|||
k6 = Klass6()
|
||||
k7 = Klass7()
|
||||
|
||||
if is_new_style_class(KlassMethods):
|
||||
KlassMethods_static = KlassMethods
|
||||
else:
|
||||
KlassMethods_static = KlassMethods()
|
||||
KlassMethods_static.methodA(k1, k2, k3, k4, k5, k6, k7)
|
||||
KlassMethods_static.methodB(k1, k2, k3, k4, k5, k6, k7)
|
||||
KlassMethods.methodA(k1, k2, k3, k4, k5, k6, k7)
|
||||
KlassMethods.methodB(k1, k2, k3, k4, k5, k6, k7)
|
||||
|
||||
k1 = getKlass1A()
|
||||
k2 = getKlass2A()
|
||||
|
|
@ -27,8 +20,8 @@ k5 = getKlass5A()
|
|||
k6 = getKlass6A()
|
||||
k7 = getKlass7A()
|
||||
|
||||
KlassMethods_static.methodA(k1, k2, k3, k4, k5, k6, k7)
|
||||
KlassMethods_static.methodB(k1, k2, k3, k4, k5, k6, k7)
|
||||
KlassMethods.methodA(k1, k2, k3, k4, k5, k6, k7)
|
||||
KlassMethods.methodB(k1, k2, k3, k4, k5, k6, k7)
|
||||
|
||||
k1 = getKlass1B()
|
||||
k2 = getKlass2B()
|
||||
|
|
@ -38,21 +31,11 @@ k5 = getKlass5B()
|
|||
k6 = getKlass6B()
|
||||
k7 = getKlass7B()
|
||||
|
||||
KlassMethods_static.methodA(k1, k2, k3, k4, k5, k6, k7)
|
||||
KlassMethods_static.methodB(k1, k2, k3, k4, k5, k6, k7)
|
||||
KlassMethods.methodA(k1, k2, k3, k4, k5, k6, k7)
|
||||
KlassMethods.methodB(k1, k2, k3, k4, k5, k6, k7)
|
||||
|
||||
if is_new_style_class(XYZMethods):
|
||||
XYZMethods_static = XYZMethods
|
||||
else:
|
||||
XYZMethods_static = XYZMethods()
|
||||
XYZMethods_static.methodA(
|
||||
XYZ1(), XYZ2(), XYZ3(), XYZ4(), XYZ5(), XYZ6(), XYZ7())
|
||||
XYZMethods_static.methodB(
|
||||
XYZ1(), XYZ2(), XYZ3(), XYZ4(), XYZ5(), XYZ6(), XYZ7())
|
||||
XYZMethods.methodA(XYZ1(), XYZ2(), XYZ3(), XYZ4(), XYZ5(), XYZ6(), XYZ7())
|
||||
XYZMethods.methodB(XYZ1(), XYZ2(), XYZ3(), XYZ4(), XYZ5(), XYZ6(), XYZ7())
|
||||
|
||||
if is_new_style_class(TheEnumMethods):
|
||||
TheEnumMethods_static = TheEnumMethods
|
||||
else:
|
||||
TheEnumMethods_static = TheEnumMethods()
|
||||
TheEnumMethods_static.methodA(theenum1, theenum2, theenum3)
|
||||
TheEnumMethods_static.methodA(theenum1, theenum2, theenum3)
|
||||
TheEnumMethods.methodA(theenum1, theenum2, theenum3)
|
||||
TheEnumMethods.methodA(theenum1, theenum2, theenum3)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue