Home | History | Annotate | Download | only in test

Lines Matching defs:__format__

124             self.assertEqual(value.__format__(format), expected)
125 self.assertEqual(value.__format__(format + 's'), expected)
179 def __format__(self, spec):
185 def __format__(self, spec):
188 # class with __str__, but no __format__
195 # class with __repr__, but no __format__ or __str__
202 # class with __format__ that forwards to string, for some format_spec's
208 def __format__(self, format_spec):
211 return object.__format__(self, format_spec)
213 # class that returns a bad type from __format__
215 def __format__(self, format_spec):
219 def __format__(self, format_spec):
223 def __format__(self, format_spec):
224 return int.__format__(self * 2, format_spec)
300 # test fallback to object.__format__
308 msg = 'object.__format__ with a non-empty format string is deprecated'
319 # test deriving from a builtin type and overriding __format__
405 __format__(self, spec):