summaryrefslogtreecommitdiff
path: root/Lib/test/test_compile.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-03-17 20:41:42 +0000
committerBenjamin Peterson <benjamin@python.org>2010-03-17 20:41:42 +0000
commit0dee9c1b5cba45c2a6c0320021f88397c559312e (patch)
tree9549f3be7acc89017dcbe30327792b846c846967 /Lib/test/test_compile.py
parent78c1871d2171b091d7249af63a4b5e3a927c0bc2 (diff)
downloadcpython-git-0dee9c1b5cba45c2a6c0320021f88397c559312e.tar.gz
prevent lambda functions from having docstrings #8164
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r--Lib/test/test_compile.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 5be65088e6..1a2009c6eb 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -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")