Home | History | Annotate | Download | only in test

Lines Matching defs:__format__

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

1071 self.assertEqual(value.__format__(format + u's'), expected)
1100 self.assertEqual(u'abc'.__format__('s'), u'abc')
1101 self.assertEqual(u'abc'.__format__('->10s'), u'-------abc')
1121 # datetime.__format__ doesn't work with unicode
1130 def __format__(self, spec):
1136 def __format__(self, spec):
1139 # class with __str__, but no __format__
1146 # class with __repr__, but no __format__ or __str__
1153 # class with __format__ that forwards to string, for some format_spec's
1159 def __format__(self, format_spec):
1162 return object.__format__(self, format_spec)
1164 # class that returns a bad type from __format__
1166 def __format__(self, format_spec):
1170 def __format__(self, format_spec):
1174 def __format__(self, format_spec):
1175 return int.__format__(self * 2, format_spec)
1251 # test fallback to object.__format__
1259 msg = 'object.__format__ with a non-empty format string is deprecated'
1270 # test deriving from a builtin type and overriding __format__
1353 def __format__(self, spec):