Home | History | Annotate | Download | only in test

Lines Matching defs:__format__

130             self.assertEqual(value.__format__(format), expected)
131 self.assertEqual(value.__format__(format + 's'), expected)
185 def __format__(self, spec):
191 def __format__(self, spec):
194 # class with __str__, but no __format__
201 # class with __repr__, but no __format__ or __str__
208 # class with __format__ that forwards to string, for some format_spec's
214 def __format__(self, format_spec):
217 return object.__format__(self, format_spec)
219 # class that returns a bad type from __format__
221 def __format__(self, format_spec):
225 def __format__(self, format_spec):
229 def __format__(self, format_spec):
230 return int.__format__(self * 2, format_spec)
306 # test fallback to object.__format__
314 msg = 'object.__format__ with a non-empty format string is deprecated'
325 # test deriving from a builtin type and overriding __format__
411 def __format__(self, spec):