Lines Matching refs:__format__
36 # Make sure __format__ is looked up on the type, not the instance.
38 def __format__(self, spec):
43 # Add a bound __format__ method to the 'y' instance, but not
46 y.__format__ = types.MethodType(lambda self, spec: 'instance', y)
52 # __format__ is not called this way, but still make sure it
55 self.assertEqual(x.__format__(''), 'class')
56 self.assertEqual(y.__format__(''), 'instance')
58 # This is how __format__ is actually called.
59 self.assertEqual(type(x).__format__(x, ''), 'class')
60 self.assertEqual(type(y).__format__(y, ''), 'class')
648 def __format__(self, spec):
924 def __format__(self, spec):
1282 # Make sure __format__ is being called.
1284 def __format__(self, s):