Home | History | Annotate | Download | only in test

Lines Matching defs:__format__

23         # Make sure __format__ is looked up on the type, not the instance.
25 def __format__(self, spec):
30 # Add a bound __format__ method to the 'y' instance, but not
33 y.__format__ = types.MethodType(lambda self, spec: 'instance', y)
39 # __format__ is not called this way, but still make sure it
42 self.assertEqual(x.__format__(''), 'class')
43 self.assertEqual(y.__format__(''), 'instance')
45 # This is how __format__ is actually called.
46 self.assertEqual(type(x).__format__(x, ''), 'class')
47 self.assertEqual(type(y).__format__(y, ''), 'class')
266 def __format__(self, spec):
491 def __format__(self, spec):