summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2006-08-28 15:27:34 (GMT)
committerGuido van Rossum <guido@python.org>2006-08-28 15:27:34 (GMT)
commit86e58e239e39845e706c4afa392423f0fedcdf39 (patch)
tree1d0f4d942e644ee5c903636d87176b98a7203371 /Python/compile.c
parentecfd0b2f3bfd622c3ba148e53d3feebb8c1ae721 (diff)
downloadcpython-86e58e239e39845e706c4afa392423f0fedcdf39.zip
cpython-86e58e239e39845e706c4afa392423f0fedcdf39.tar.gz
cpython-86e58e239e39845e706c4afa392423f0fedcdf39.tar.bz2
SF patch 1547796 by Georg Brandl -- set literals.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 4601f2c..945a281 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -851,6 +851,7 @@ opcode_stack_effect(int opcode, int oparg)
return 1;
case BUILD_TUPLE:
case BUILD_LIST:
+ case BUILD_SET:
return 1-oparg;
case BUILD_MAP:
return 1;
@@ -2955,6 +2956,11 @@ compiler_visit_expr(struct compiler *c, expr_ty e)
ADDOP(c, STORE_SUBSCR);
}
break;
+ case Set_kind:
+ n = asdl_seq_LEN(e->v.Set.elts);
+ VISIT_SEQ(c, expr, e->v.Set.elts);
+ ADDOP_I(c, BUILD_SET, n);
+ break;
case ListComp_kind:
return compiler_listcomp(c, e);
case GeneratorExp_kind: