Ejemplo n.º 1
0
 def __init__( self ):
    print_flushed( 'in MyModule.MyPyClass.__init__' )
Ejemplo n.º 2
0
 def __init__(self):
     print_flushed('in MyOtherPyClass.__init__')
     MyOtherPyClass.count += 1
Ejemplo n.º 3
0
from force_flush import print_flushed

print_flushed( 'loading MyModule.py ... ' )

class MyPyClass( object ):
   def __init__( self ):
      print_flushed( 'in MyModule.MyPyClass.__init__' )

   def gime( self, what ):
      return what
Ejemplo n.º 4
0
 def hop(self):
     print_flushed('another hop')
Ejemplo n.º 5
0
 def duck(self):
     print_flushed('quack')
Ejemplo n.º 6
0
 def hop(self):
     print_flushed('hop')
Ejemplo n.º 7
0
 def __del__(self):
     print_flushed('in MyOtherPyClass.__del__')
     MyOtherPyClass.count -= 1
Ejemplo n.º 8
0
from force_flush import print_flushed

print_flushed('creating class MyOtherPyClass ... ')


class MyOtherPyClass:
    count = 0

    def __init__(self):
        print_flushed('in MyOtherPyClass.__init__')
        MyOtherPyClass.count += 1

    def __del__(self):
        print_flushed('in MyOtherPyClass.__del__')
        MyOtherPyClass.count -= 1

    def hop(self):
        print_flushed('hop')

    def duck(self):
        print_flushed('quack')


# include a class that may interfere with the previous one due to
# same-named method in it
class MyYetAnotherPyClass:
    def hop(self):
        print_flushed('another hop')