mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
prevent lambda functions from having docstrings #8164
This commit is contained in:
parent
78c1871d21
commit
0dee9c1b5c
3 changed files with 11 additions and 0 deletions
|
@ -353,6 +353,10 @@ if 1:
|
|||
f1, f2 = f()
|
||||
self.assertNotEqual(id(f1.func_code), id(f2.func_code))
|
||||
|
||||
def test_lambda_doc(self):
|
||||
l = lambda: "foo"
|
||||
self.assertIsNone(l.__doc__)
|
||||
|
||||
def test_unicode_encoding(self):
|
||||
code = u"# -*- coding: utf-8 -*-\npass\n"
|
||||
self.assertRaises(SyntaxError, compile, code, "tmp", "exec")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue