mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
		
			
				
	
	
		
			29 lines
		
	
	
	
		
			399 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			399 B
		
	
	
	
		
			Python
		
	
	
	
	
	
"""
 | 
						|
_PyType_Lookup() returns a borrowed reference.
 | 
						|
This attacks the call in dictobject.c.
 | 
						|
"""
 | 
						|
 | 
						|
class A(object):
 | 
						|
    pass
 | 
						|
 | 
						|
class B(object):
 | 
						|
    def __del__(self):
 | 
						|
        print('hi')
 | 
						|
        del D.__missing__
 | 
						|
 | 
						|
class D(dict):
 | 
						|
    class __missing__:
 | 
						|
        def __init__(self, *args):
 | 
						|
            pass
 | 
						|
 | 
						|
 | 
						|
d = D()
 | 
						|
a = A()
 | 
						|
a.cycle = a
 | 
						|
a.other = B()
 | 
						|
del a
 | 
						|
 | 
						|
prev = None
 | 
						|
while 1:
 | 
						|
    d[5]
 | 
						|
    prev = (prev,)
 |