Home | History | Annotate | Download | only in test

Lines Matching defs:__format__

112             self.assertEqual(value.__format__(format), expected)

113 self.assertEqual(value.__format__(format + 's'), expected)
167 def __format__(self, spec):
173 def __format__(self, spec):
176 # class with __str__, but no __format__
183 # class with __repr__, but no __format__ or __str__
190 # class with __format__ that forwards to string, for some format_spec's
196 def __format__(self, format_spec):
199 return object.__format__(self, format_spec)
201 # class that returns a bad type from __format__
203 def __format__(self, format_spec):
207 def __format__(self, format_spec):
211 def __format__(self, format_spec):
212 return int.__format__(self * 2, format_spec)
288 # test fallback to object.__format__
296 msg = 'object.__format__ with a non-empty format string is deprecated'
307 # test deriving from a builtin type and overriding __format__
378 def __format__(self, spec):