Skip to content

Conversation

@orenmn
Copy link
Contributor

@orenmn orenmn commented Oct 1, 2017

  • In case the argument of _random.Random.seed() is a long/int subclass, ignore its __abs__() method.
  • Add a test to test_random to verify that such __abs__() methods are indeed ignored.

https://bugs.python.org/issue31478

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a NEWS entry.

expected_value = self.gen.random()
for seed_arg in [42L, BadInt(42), BadLong(42)]:
self.gen.seed(seed_arg)
self.assertEqual(expected_value, self.gen.random())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the actual value at left and the expected value at right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants