mirror of
https://github.com/python/cpython.git
synced 2025-07-12 05:45:15 +00:00
bpo-29695: Deprecated using bad named keyword arguments in builtings: (#486)
int(), bool(), float(), list() and tuple(). Specify the value as a positional argument instead.
This commit is contained in:
parent
d31b28e16a
commit
58d23e6806
12 changed files with 65 additions and 2 deletions
|
@ -170,6 +170,10 @@ class BoolTest(unittest.TestCase):
|
|||
self.assertIs(bool(""), False)
|
||||
self.assertIs(bool(), False)
|
||||
|
||||
def test_keyword_args(self):
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
self.assertIs(bool(x=10), True)
|
||||
|
||||
def test_format(self):
|
||||
self.assertEqual("%d" % False, "0")
|
||||
self.assertEqual("%d" % True, "1")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue