Skip to content

Commit ed55ae8

Browse files
author
Philip Guo
committed
start integrating some of john's changes
1 parent 9126b2c commit ed55ae8

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

‎v3/pg_encoder.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ def encode(self, dat):
170170
func_name = get_name(dat)
171171
pretty_name = func_name + '(' + ', '.join(printed_args) + ')'
172172
new_obj.extend(['FUNCTION', pretty_name, None]) # the final element will be filled in later
173+
elif typ is types.BuiltinFunctionType:
174+
pretty_name = get_name(dat) + '(...)'
175+
new_obj.extend(['FUNCTION', pretty_name, None])
173176
elif self.is_class(dat) or self.is_instance(dat):
174177
self.encode_class_or_instance(dat, new_obj)
175178
elif typ is types.ModuleType:
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# make sure OPT finds f as the parent of g
2+
def f(x, y):
3+
def g(x):
4+
return x + y
5+
return g(3)
6+
7+
f(1, 2)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# make sure OPT finds horse as parent of mask
2+
def horse(mask):
3+
horse = mask
4+
def mask(horse):
5+
return horse
6+
return horse(mask)
7+
8+
mask = lambda horse: horse(2)
9+
10+
horse(mask)

0 commit comments

Comments
 (0)