Skip to content

Remove old-style classes from test_cmath #98727

@sobolevn

Description

@sobolevn

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:

# 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/ directorytestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions