OILS / opy / gold / load_make_closure.py View on Github | oilshell.org

13 lines, 3 significant
1#!/usr/bin/env python2
2"""
3load_make_closure.py - A generator expression should not generate the
4LOAD_CLOSURE or MAKE_CLOSURE bytecodes.
5"""
6# Copied from core/braces.py
7# It erroneously generaets a closure because of:
8# co_freevars: ('parts_list',)
9#
10# In CPython that list is empty.
11def BraceExpandWords(words):
12 parts_list = []
13 print(p for p in parts_list if len(p) > 2)