Skip to content

Commit 577382c

Browse files
committed
Unicode lambdas :)
1 parent 3cf4482 commit 577382c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

PyTutorGAE/pg_encoder.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,10 @@ def encode(self, dat):
168168
if argspec.keywords:
169169
printed_args.extend(['**' + e for e in argspec.keywords])
170170

171-
pretty_name = get_name(dat) + '(' + ', '.join(printed_args) + ')'
171+
func_name = get_name(dat)
172+
if func_name == '<lambda>':
173+
func_name = u"\u03BB" # Unicode lambda :)
174+
pretty_name = func_name + '(' + ', '.join(printed_args) + ')'
172175
new_obj.extend(['FUNCTION', pretty_name, None]) # the final element will be filled in later
173176
else:
174177
typeStr = str(typ)

PyTutorGAE/pg_logger.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,10 @@ def create_encoded_stack_entry(cur_frame):
258258

259259
cur_name = cur_frame.f_code.co_name
260260

261-
# special case for lambdas - grab their line numbers too
261+
# special case for lambdas - grab their line numbers too (or not)
262262
if cur_name == '<lambda>':
263-
cur_name = '<lambda:line ' + str(cur_frame.f_code.co_firstlineno) + '>'
263+
# Unicode lambda :)
264+
cur_name = u"\u03BB" # + ':line' + str(cur_frame.f_code.co_firstlineno)
264265
elif cur_name == '':
265266
cur_name = 'unnamed function'
266267

0 commit comments

Comments
 (0)