| OLD | NEW |
| 1 import builtins | 1 import builtins |
| 2 import sys | 2 import sys |
| 3 import types | 3 import types |
| 4 import math | 4 import math |
| 5 import unittest | 5 import unittest |
| 6 | 6 |
| 7 from copy import deepcopy | 7 from copy import deepcopy |
| 8 from test import support | 8 from test import support |
| 9 | 9 |
| 10 | 10 |
| (...skipping 2050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2061 m2instance.a = 1 | 2061 m2instance.a = 1 |
| 2062 self.assertEqual(m2instance.__dict__, "Not a dict!") | 2062 self.assertEqual(m2instance.__dict__, "Not a dict!") |
| 2063 try: | 2063 try: |
| 2064 dir(m2instance) | 2064 dir(m2instance) |
| 2065 except TypeError: | 2065 except TypeError: |
| 2066 pass | 2066 pass |
| 2067 | 2067 |
| 2068 # Two essentially featureless objects, just inheriting stuff from | 2068 # Two essentially featureless objects, just inheriting stuff from |
| 2069 # object. | 2069 # object. |
| 2070 self.assertEqual(dir(NotImplemented), dir(Ellipsis)) | 2070 self.assertEqual(dir(NotImplemented), dir(Ellipsis)) |
| 2071 if support.check_impl_detail(): | |
| 2072 # None differs in PyPy: it has a __nonzero__ | |
| 2073 self.assertEqual(dir(None), dir(Ellipsis)) | |
| 2074 | 2071 |
| 2075 # Nasty test case for proxied objects | 2072 # Nasty test case for proxied objects |
| 2076 class Wrapper(object): | 2073 class Wrapper(object): |
| 2077 def __init__(self, obj): | 2074 def __init__(self, obj): |
| 2078 self.__obj = obj | 2075 self.__obj = obj |
| 2079 def __repr__(self): | 2076 def __repr__(self): |
| 2080 return "Wrapper(%s)" % repr(self.__obj) | 2077 return "Wrapper(%s)" % repr(self.__obj) |
| 2081 def __getitem__(self, key): | 2078 def __getitem__(self, key): |
| 2082 return Wrapper(self.__obj[key]) | 2079 return Wrapper(self.__obj[key]) |
| 2083 def __len__(self): | 2080 def __len__(self): |
| (...skipping 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4333 type.mro(tuple) | 4330 type.mro(tuple) |
| 4334 | 4331 |
| 4335 | 4332 |
| 4336 def test_main(): | 4333 def test_main(): |
| 4337 # Run all local test cases, with PTypesLongInitTest first. | 4334 # Run all local test cases, with PTypesLongInitTest first. |
| 4338 support.run_unittest(PTypesLongInitTest, OperatorsTest, | 4335 support.run_unittest(PTypesLongInitTest, OperatorsTest, |
| 4339 ClassPropertiesAndMethods, DictProxyTests) | 4336 ClassPropertiesAndMethods, DictProxyTests) |
| 4340 | 4337 |
| 4341 if __name__ == "__main__": | 4338 if __name__ == "__main__": |
| 4342 test_main() | 4339 test_main() |
| OLD | NEW |