mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Issue 4998: restore utility of __slots__ on Fraction.
(forward merge of r68813).
This commit is contained in:
parent
bc448664af
commit
c28ad27dbb
3 changed files with 19 additions and 0 deletions
|
@ -407,6 +407,11 @@ class FractionTest(unittest.TestCase):
|
|||
self.assertEqual(id(r), id(copy(r)))
|
||||
self.assertEqual(id(r), id(deepcopy(r)))
|
||||
|
||||
def test_slots(self):
|
||||
# Issue 4998
|
||||
r = F(13, 7)
|
||||
self.assertRaises(AttributeError, setattr, r, 'a', 10)
|
||||
|
||||
def test_main():
|
||||
run_unittest(FractionTest, GcdTest)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue