-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
Closed
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Right now old-style classes are long gone. But, test_cmath
still tests for them and has an outdated comment about them being not fully supported:
cpython/Lib/test/test_cmath.py
Lines 258 to 265 in 365852a
# TypeError should be raised for classes not providing | |
# either __complex__ or __float__, even if they provide | |
# __int__ or __index__. An old-style class | |
# currently raises AttributeError instead of a TypeError; | |
# this could be considered a bug. | |
self.assertRaises(TypeError, f, NeitherComplexNorFloat()) | |
self.assertRaises(TypeError, f, MyInt()) | |
self.assertRaises(Exception, f, NeitherComplexNorFloatOS()) |
I will send a PR with removal of old style classes, correct exception handling, and comment rewording.
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error