Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 2005:ed5d0ad5ea2f legacy-trunk
set name to <lambda> instead of None for lambdas
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 10 Nov 1994 22:40:34 +0000 |
| parents | 39a4c15acb32 |
| children | d7e91437f0a2 |
line wrap: on
line diff
--- a/Python/compile.c Thu Nov 10 22:35:48 1994 +0000 +++ b/Python/compile.c Thu Nov 10 22:40:34 1994 +0000 @@ -2274,7 +2274,7 @@ { node *ch; REQ(n, lambdef); /* lambdef: 'lambda' [parameters] ':' test */ - c->c_name = NULL; + c->c_name = "<lambda>"; ch = CHILD(n, 1); if (TYPE(ch) == COLON) { @@ -2515,12 +2515,7 @@ if (sc.c_errors == 0) { object *v, *w; v = newstringobject(sc.c_filename); - if (sc.c_name) - w = newstringobject(sc.c_name); - else { - INCREF(None); - w = None; - } + w = newstringobject(sc.c_name); if (v != NULL && w != NULL) co = newcodeobject(sc.c_code, sc.c_consts, sc.c_names, v, w);
