File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
python/ql/test/experimental/library-tests/CallGraph/code Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -44,15 +44,27 @@ def __new__(cls, arg):
4444 inst .some_method () # $ MISSING: pt,tt=WithNew.some_method
4545 return inst
4646
47- def __init__ (self , arg ):
47+ def __init__ (self , arg = None ):
4848 print ("WithNew.__init__" , arg )
4949
5050 def some_method (self ):
51- print ("WithNew.__init__ " )
51+ print ("WithNew.some_method " )
5252
5353WithNew (44 ) # $ tt=WithNew.__new__ tt=WithNew.__init__
5454print ()
5555
56+ class WithNewSub (WithNew ):
57+ def __new__ (cls ):
58+ print ("WithNewSub.__new__" )
59+ inst = super ().__new__ (cls , 44.1 ) # $ pt,tt=WithNew.__new__
60+ assert isinstance (inst , cls )
61+ inst .some_method () # $ MISSING: pt,tt=WithNew.some_method
62+ return inst
63+
64+ WithNewSub () # $ tt=WithNewSub.__new__ tt=WithNew.__init__
65+ print ()
66+
67+ # ------------------------------------------------------------------------------
5668
5769class ExtraCallToInit (object ):
5870 def __new__ (cls , arg ):
You can’t perform that action at this time.
0 commit comments