Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6006629

Browse files
committed
Remove obsolete __dynamic__ distinction.
1 parent 1ce150c commit 6006629

2 files changed

Lines changed: 1 addition & 76 deletions

File tree

Lib/test/test_inspect.py

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,9 @@ def m1(self): pass
297297
test(('m1', 'method', D) in attrs, 'missing plain method')
298298
test(('datablob', 'data', A) in attrs, 'missing data')
299299

300-
# Repeat all that, but w/ new-style non-dynamic classes.
300+
# Repeat all that, but w/ new-style classes.
301301

302302
class A(object):
303-
__dynamic__ = 0
304303

305304
def s(): pass
306305
s = staticmethod(s)
@@ -326,7 +325,6 @@ def m1(self): pass
326325
test(('datablob', 'data', A) in attrs, 'missing data')
327326

328327
class B(A):
329-
__dynamic__ = 0
330328

331329
def m(self): pass
332330

@@ -340,7 +338,6 @@ def m(self): pass
340338

341339

342340
class C(A):
343-
__dynamic__ = 0
344341

345342
def m(self): pass
346343
def c(self): pass
@@ -354,76 +351,6 @@ def c(self): pass
354351
test(('datablob', 'data', A) in attrs, 'missing data')
355352

356353
class D(B, C):
357-
__dynamic__ = 0
358-
359-
def m1(self): pass
360-
361-
attrs = attrs_wo_objs(D)
362-
test(('s', 'static method', A) in attrs, 'missing static method')
363-
test(('c', 'method', C) in attrs, 'missing plain method')
364-
test(('p', 'property', A) in attrs, 'missing property')
365-
test(('m', 'method', B) in attrs, 'missing plain method')
366-
test(('m1', 'method', D) in attrs, 'missing plain method')
367-
test(('datablob', 'data', A) in attrs, 'missing data')
368-
369-
# And again, but w/ new-style dynamic classes.
370-
371-
class A(object):
372-
__dynamic__ = 1
373-
374-
def s(): pass
375-
s = staticmethod(s)
376-
377-
def c(cls): pass
378-
c = classmethod(c)
379-
380-
def getp(self): pass
381-
p = property(getp)
382-
383-
def m(self): pass
384-
385-
def m1(self): pass
386-
387-
datablob = '1'
388-
389-
attrs = attrs_wo_objs(A)
390-
test(('s', 'static method', A) in attrs, 'missing static method')
391-
test(('c', 'class method', A) in attrs, 'missing class method')
392-
test(('p', 'property', A) in attrs, 'missing property')
393-
test(('m', 'method', A) in attrs, 'missing plain method')
394-
test(('m1', 'method', A) in attrs, 'missing plain method')
395-
test(('datablob', 'data', A) in attrs, 'missing data')
396-
397-
class B(A):
398-
__dynamic__ = 1
399-
400-
def m(self): pass
401-
402-
attrs = attrs_wo_objs(B)
403-
test(('s', 'static method', A) in attrs, 'missing static method')
404-
test(('c', 'class method', A) in attrs, 'missing class method')
405-
test(('p', 'property', A) in attrs, 'missing property')
406-
test(('m', 'method', B) in attrs, 'missing plain method')
407-
test(('m1', 'method', A) in attrs, 'missing plain method')
408-
test(('datablob', 'data', A) in attrs, 'missing data')
409-
410-
411-
class C(A):
412-
__dynamic__ = 1
413-
414-
def m(self): pass
415-
def c(self): pass
416-
417-
attrs = attrs_wo_objs(C)
418-
test(('s', 'static method', A) in attrs, 'missing static method')
419-
test(('c', 'method', C) in attrs, 'missing plain method')
420-
test(('p', 'property', A) in attrs, 'missing property')
421-
test(('m', 'method', C) in attrs, 'missing plain method')
422-
test(('m1', 'method', A) in attrs, 'missing plain method')
423-
test(('datablob', 'data', A) in attrs, 'missing data')
424-
425-
class D(B, C):
426-
__dynamic__ = 1
427354

428355
def m1(self): pass
429356

Lib/xml/dom/minidom.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434

3535
if list is type([]):
3636
class NodeList(list):
37-
__dynamic__ = 0
38-
3937
def item(self, index):
4038
if 0 <= index < len(self):
4139
return self[index]

0 commit comments

Comments
 (0)