17+ results for 'f_lasti' (0 ms)

Not the results you expected?

debug.py (https://bitbucket.org/apratim_ankur/sawari_renewed1.git) Python · 70 lines

41 except IOError:

42 line = 'Unknown code named [%s]. VM instruction #%d' % (

43 frame.f_code.co_name, frame.f_lasti)

44 if self.trace_names is None or name in self.trace_names:

45 print('%s:%s: %s' % (name, lineno, line.rstrip()))

skip.py (http://pydbgr.googlecode.com/svn/trunk/) Python · 92 lines

55 pass

56 co = self.proc.curframe.f_code

57 offset = self.proc.curframe.f_lasti

58 if count is None: return False

59 lineno = Mbytecode.next_linestart(co, offset, count)

bytecode.py (http://pydbgr.googlecode.com/svn/trunk/) Python · 126 lines

28 def op_at_frame(frame, loc=None):

29 code = frame.f_code.co_code

30 if loc is None: loc = frame.f_lasti

31 return op_at_code_loc(code, loc)

32

utils.py (https://code.google.com/p/webapp-improved/) Python · 0 lines

43 prefix = 'running generator '

44 elif frame:

45 if frame.f_lasti < 0:

46 prefix = 'initial generator '

47 else:

line.py (http://pydbgr.googlecode.com/svn/trunk/) Python · 114 lines

89 msg1 = 'Line %d of \"%s\"' % (inspect.getlineno(self.proc.curframe),

90 self.core.filename(filename))

91 msg2 = ('at instruction %d' % self.proc.curframe.f_lasti)

92 if self.proc.event:

93 msg2 += ', %s event' % self.proc.event

einfo.py (https://bitbucket.org/lina_wang_veeva/vone.git) Python · 134 lines

48 self.f_code = self.Code(frame.f_code)

49 self.f_lineno = frame.f_lineno

50 self.f_lasti = frame.f_lasti

51 # don't want to hit https://bugs.python.org/issue21967

52 self.f_restricted = False

debug.py (https://bitbucket.org/which_linden/eventlet-libevent) Python · 105 lines

33 except IOError:

34 line = 'Unknown code named [%s]. VM instruction #%d' % (

35 frame.f_code.co_name, frame.f_lasti)

36 if self.trace_names is None or name in self.trace_names:

37 print '%s:%s: %s' % (name, lineno, line.rstrip())

program.py (http://pydbgr.googlecode.com/svn/trunk/) Python · 92 lines

46 self.settings['width']))

47 if self.proc.curframe:

48 self.msg("PC offset is %d." % self.proc.curframe.f_lasti)

49

50 if self.proc.event == 'return':

currentframes.py (https://bitbucket.org/pypy/pypy/) Python · 78 lines ✨ Summary

This code implements a mock version of Python’s _current_frames() function, which returns a dictionary mapping each current thread to its corresponding stack frame. In PyPy, this function returns fake frame objects instead of actual frames to avoid runtime penalties from JIT compilation. The implementation uses a custom fake_frame class and a wrapper around the fake_frame object to create a call stack.

21 f_exc_value = None

22 f_globals = {}

23 f_lasti = -1

24 f_lineno = 0

25 f_locals = {}

29 def __init__(self, f):

30 if f is not None:

31 for name in ["f_builtins", "f_code", "f_globals", "f_lasti",

32 "f_lineno"]:

33 setattr(self, name, getattr(f, name))

ompc_mfunction_poormans.py (https://bitbucket.org/juricap/ompc/) Python · 147 lines ✨ Summary

The code generates a wrapper function for existing functions using the mfunction decorator, which adds documentation and error checking to the original function. It creates a temporary Python file with the modified function source code, executes it, and returns the new function object. The output is a series of print statements demonstrating the usage of two generated functions: coinflip and add.

12 f = f.f_back.f_back

13 c = f.f_code

14 i = f.f_lasti

15 bytecode = c.co_code

16 instruction = ord(bytecode[i+3])

run_trace.py (https://bitbucket.org/ned/coveragepy/) Python · 36 lines

20 os.path.basename(frame.f_code.co_filename),

21 frame.f_lineno,

22 frame.f_lasti,

23 )

24

reassembly.py (https://bitbucket.org/fj_/randomscripts) Python · 126 lines

25 print name, ldict[name]

26 locals.append(ldict[name])

27 return Saved_frame(frame.f_lasti, locals, retval)

28

29 class Instruction(object):

coroutines.py (https://bitbucket.org/jaraco/cpython-issue13540) Python · 196 lines

87 frame = sys._getframe()

88 caller = frame.f_back

89 assert caller.f_lasti >= 0

90 if caller.f_code.co_code[caller.f_lasti] != _YIELD_FROM:

117 gen = getattr(self, 'gen', None)

118 frame = getattr(gen, 'gi_frame', None)

119 if frame is not None and frame.f_lasti == -1:

120 msg = '%r was never yielded from' % self

121 tb = getattr(self, '_source_traceback', ())

tail_recursion.py (https://bitbucket.org/pmatiello/tail-recursion) Python · 55 lines

28 caller_frame = frame.f_back

29 code = caller_frame.f_code.co_code

30 ip = caller_frame.f_lasti

31 return code[ip + 3] in OPCODES

32

tracing_opcode_gen.py (https://bitbucket.org/markshannon/hotpy_2) Python · 68 lines

6 {

7 int b;

8 RECORD_SET_LASTI(f->f_lasti);

9 w = POP();

10 v = POP();

32 {

33 int b;

34 RECORD_SET_LASTI(f->f_lasti);

35 w = POP();

36 v = POP();

56 for opname in unary_operators:

57 print(''' TARGET(UNARY_%s)

58 RECORD_SET_LASTI(f->f_lasti);

59 w = POP();

60 REQUIRE_TYPE(1, Py_TYPE(w));

dumper.py (https://bitbucket.org/tenuki/sleepy) Python · 81 lines

15 @property

16 def lasti(self):

17 return self.frame.f_lasti

18

19 @property

41 if truncate and (f.f_code.co_filename == '<string>'):

42 return

43 yield (f.f_code.co_filename, f.f_lineno, f.f_lasti)

44 f = f.f_back

45 return [f for f in gen()]

tracedebug.py (https://bitbucket.org/tenuki/sleepy) Python · 42 lines

23 _show[k] = frame.f_locals[k]

24 print COL_DEF%(event, fn, frame.f_lineno,

25 frame.f_lasti, repr(_show))

26

27 if event=='return' and (fn=='test1.py'):