[Python-Dev] Re: C API: Move PEP 523 "Adding a frame evaluation API to CPython" private C API to the internal C API

2022-04-22 Thread Fabio Zadrozny
ch the code object in the frame before it's actually executed? -- i.e.: the debugger changes the state.interp.eval_frame to its own custom evaluation function, but _PyEval_EvalFrameDefault is still what ends up being called afterwards (it works more as a hook to change the PyFrameObject.f_code prior to e

[Python-Dev] Re: C API: Move PEP 523 "Adding a frame evaluation API to CPython" private C API to the internal C API

2022-03-24 Thread Fabio Zadrozny
Em qui., 24 de mar. de 2022 às 15:39, Fabio Zadrozny escreveu: > PEP 523 API added more private functions for code objects: >> >> * _PyEval_RequestCodeExtraIndex() >> * _PyCode_GetExtra() >> * _PyCode_SetExtra() >> >> The _PyEval_RequestCodeExtraIndex() fun

[Python-Dev] Re: C API: Move PEP 523 "Adding a frame evaluation API to CPython" private C API to the internal C API

2022-03-24 Thread Fabio Zadrozny
> > PEP 523 API added more private functions for code objects: > > * _PyEval_RequestCodeExtraIndex() > * _PyCode_GetExtra() > * _PyCode_SetExtra() > > The _PyEval_RequestCodeExtraIndex() function seems to be used by the > pydevd debugger. The two others seem to be unused in the wild. I'm not >

[Python-Dev] Re: Compiling of ast.Module in Python 3.10 and co_firstlineno behavior

2022-02-18 Thread Fabio Zadrozny
Em qui., 17 de fev. de 2022 às 17:55, Gabriele escreveu: > Hi Fabio > > Does the actual function object get re-created as well during the > recompilation process that you have described? Perhaps it might help > to note that the __code__ attribute of a function object f can be > mutated and that

[Python-Dev] Re: Compiling of ast.Module in Python 3.10 and co_firstlineno behavior

2022-02-17 Thread Fabio Zadrozny
Em qui., 17 de fev. de 2022 às 16:05, Mark Shannon escreveu: > Hi Fabio, > > This happened as part of implementing PEP 626. > The previous behavior isn't very robust w.r.t doc strings and > compiler optimizations. > > OOI, why would you want to revert to the old behavior? > > Hi Mark, The issue

[Python-Dev] Compiling of ast.Module in Python 3.10 and co_firstlineno behavior

2022-02-17 Thread Fabio Zadrozny
Hi all, I'm stumbling with an issue where the co_firstlineno behavior changed from Python 3.9 to Python 3.10 and I was wondering if this was intentional or not. i.e.: Whenever a code is compiled in Python 3.10, the `code.co_firstlineno` is now always 1, whereas previously it was equal to the

[Python-Dev] Re: What's the rule for issuing line tracing numbers when using a tracing function?

2021-09-17 Thread Fabio Zadrozny
Em qui., 16 de set. de 2021 às 11:49, Fabio Zadrozny escreveu: > Hi all, > > I have a weird case where I thought line events would be issued and yet > they aren't even though they're in the instructions in the bytecode (both > in 3.9 and 3.10). > > i.e.: > &

[Python-Dev] What's the rule for issuing line tracing numbers when using a tracing function?

2021-09-16 Thread Fabio Zadrozny
Hi all, I have a weird case where I thought line events would be issued and yet they aren't even though they're in the instructions in the bytecode (both in 3.9 and 3.10). i.e.: Given the code: def check_backtrack(x): # line 1 if not (x == 'a' # line 2 or x == 'c'): # line 3

[Python-Dev] Re: API's to interface python with Eclipse to execute and debug C/C++ Source files.

2021-09-04 Thread Fabio Zadrozny
Em qui., 19 de ago. de 2021 às 01:57, Chandrakant Shrimantrao < chandrakant.shrimant...@ltts.com> escreveu: > Hi, > We would like to know if there is any option available to execute and > debug( setting break point and delete break point) C/C++ Source files > Python API's inside Eclipse IDE

[Python-Dev] Fixing unbuffered output on Windows

2021-07-02 Thread Fabio Zadrozny
Hi all, I've created a pull request some time ago to fix https://bugs.python.org/issue42044 ( https://github.com/python/cpython/pull/26678). I know python devs are pretty busy, but I'd really appreciate it if someone could take a look at it (as I *think* it's a simple fix). Thanks, Fabio

[Python-Dev] Re: PEP 659: Specializing Adaptive Interpreter

2021-05-14 Thread Fabio Zadrozny
> > > 3. Another example: I'm working right now on a feature to step into a > > method. To do that right now my approach is: > > - Compute the function call names and bytecode offsets in a given > > frame. > > - When a frame is called (during a frame.f_trace call), check the > > parent

[Python-Dev] Re: PEP 659: Specializing Adaptive Interpreter

2021-05-13 Thread Fabio Zadrozny
Em qua., 12 de mai. de 2021 às 14:45, Mark Shannon escreveu: > Hi everyone, > > I would like to present PEP 659. > > This is an informational PEP about a key part of our plan to improve > CPython performance for 3.11 and beyond. > > For those of you aware of the recent releases of Cinder and

[Python-Dev] f_lasti not correct with PREDICT (is it fixable?)

2021-04-17 Thread Fabio Zadrozny
Hi all, I currently have a use-case where I need to rely on `f_lasti`, but it seems that it's not really possible to rely on it as it doesn't accurately point to the actual bytecode last executed when PREDICT is used. So, I'd like to know: is it possible to change that so that the `f_lasti` is

[Python-Dev] Re: Improve CPython tracing performance

2020-10-30 Thread Fabio Zadrozny
On Fri, Oct 30, 2020 at 7:02 AM Nick Coghlan wrote: > On Fri, 30 Oct 2020 at 00:19, Fabio Zadrozny wrote: > > On Thu, Oct 29, 2020 at 9:45 AM Victor Stinner > wrote: > >> > >> > If it's non controversial, is a PEP needed or just an issue to track > it wou

[Python-Dev] Re: Improve CPython tracing performance

2020-10-29 Thread Fabio Zadrozny
On Thu, Oct 29, 2020 at 9:45 AM Victor Stinner wrote: > Le jeu. 29 oct. 2020 à 13:02, Fabio Zadrozny a écrit : > > Debuggers can call `PyFrame_LocalsToFast` when needed -- otherwise > mutating non-current frames doesn't work anyways. As a note, pydevd already > has such

[Python-Dev] Improve CPython tracing performance

2020-10-29 Thread Fabio Zadrozny
Hi all, Right now, when a debugger is active, the number of local variables can affect the tracing speed quite a lot. For instance, having tracing setup in a program such as the one below takes 4.64 seconds to run, yet, changing all the variables to have the same name -- i.e.: change all

[Python-Dev] Re: PEP: Modify the C API to hide implementation details

2020-04-13 Thread Fabio Zadrozny
> * Hide implementation details from the C API to be able to `optimize > CPython`_ and make PyPy more efficient. > * The expectation is that `most C extensions don't rely directly on > CPython internals`_ and so will remain compatible. > * Continue to support old unmodified C extensions by

[Python-Dev] Re: PEP 617: New PEG parser for CPython

2020-04-06 Thread Fabio Zadrozny
On Thu, Apr 2, 2020 at 3:16 PM Guido van Rossum wrote: > Since last fall's core sprint in London, Pablo Galindo Salgado, Lysandros > Nikolaou and myself have been working on a new parser for CPython. We are > now far enough along that we present a PEP we've written: > >

[Python-Dev] Re: Debug C++

2020-03-31 Thread Fabio Zadrozny
If you're on Windows, another option would be doing a remote attach from Visual Studio C++ -- so, you can start the program under debugging in Python and then do an attach to process from Visual Studio C++. On Mon, Mar 30, 2020 at 9:07 PM Rhodri James wrote: > On 30/03/2020 23:20, Leandro

[Python-Dev] Re: Mixed Python/C debugging

2019-12-02 Thread Fabio Zadrozny
Hi Skip, I just wanted to note that what I usually do in this case is having 2 debuggers attached. i.e.: start one any way you want and then do an attach to from the other debugger -- in my case as I'm usually on the Python side I usually start the Python debugger and then do an attach to from

[Python-Dev] Re: Setting frame evaluation function (i.e.:PyInterpreterState.frame_eval)

2019-10-17 Thread Fabio Zadrozny
On Wed, Oct 16, 2019 at 1:05 PM Victor Stinner wrote: > Would you mind to open an issue at bugs.python.org? You can put me > ("vstinner") in the nosy list. > Done: https://bugs.python.org/issue38500 > > Victor > > Le mer. 16 oct. 2019 à 17:07, Fabio Zadrozny a

[Python-Dev] Re: Setting frame evaluation function (i.e.:PyInterpreterState.frame_eval)

2019-10-16 Thread Fabio Zadrozny
be nicer to have some method to set up the frame evaluation function instead of pulling up the internal C API, but it's also *very* specialized, so, I'm not sure how much it's worth it (I'm happy with just being able to do it, even if it's not very straightforward). Best Regards, Fabio Le m

[Python-Dev] Setting frame evaluation function (i.e.:PyInterpreterState.frame_eval)

2019-10-16 Thread Fabio Zadrozny
Hi All, I'm trying to upgrade the pydevd debugger to the latest version of CPython (3.8), however I'm having some issues being able to access `PyInterpreterState.eval_frame` when compiling, so, I'd like to ask if someone can point me in the right direction. What I'm trying to do is compile

Re: [Python-Dev] Store startup modules as C structures for 20%+ startup speed improvement?

2018-09-18 Thread Fabio Zadrozny
On Tue, Sep 18, 2018 at 2:57 PM, Carl Shapiro wrote: > On Tue, Sep 18, 2018 at 5:55 AM, Fabio Zadrozny wrote: > >> During the import process, Python can already deal with folders and .zip >> files in sys.path... now, instead of having special handling for a new >> conce

Re: [Python-Dev] Store startup modules as C structures for 20%+ startup speed improvement?

2018-09-18 Thread Fabio Zadrozny
On Mon, Sep 17, 2018 at 9:23 PM, Carl Shapiro wrote: > On Sun, Sep 16, 2018 at 1:24 PM, Antoine Pitrou > wrote: > >> I think it's of limited interest if it only helps with modules used >> during the startup sequence, not arbitrary stdlib or third-party >> modules. >> > > This should help any

Re: [Python-Dev] PEP 553: Built-in debug()

2017-09-06 Thread Fabio Zadrozny
Hi Barry, I think it's a nice idea. Related to the name, on the windows c++ there's "DebugBreak": https://msdn.microsoft.com/en-us/library/windows/desktop/ms679297(v=vs.85).aspx, which I think is a better name (so, it'd be debug_break for Python -- I think it's better than plain breakpoint(),

Re: [Python-Dev] Deprecate `from __future__ import unicode_literals`?

2016-12-20 Thread Fabio Zadrozny
On Mon, Dec 19, 2016 at 11:50 PM, Chris Barker wrote: > Please don't get rid of unicode+literals -- I don't even think we should > depreciate it as a recommendation or discourage it. > > Maybe a note or two added as to where issues may arise would be good. > > I've found

Re: [Python-Dev] Parsing f-strings from PEP 498 -- Literal String Interpolation

2016-11-09 Thread Fabio Zadrozny
On Sat, Nov 5, 2016 at 10:36 AM, Nick Coghlan <ncogh...@gmail.com> wrote: > On 5 November 2016 at 04:03, Fabio Zadrozny <fabi...@gmail.com> wrote: > > On Fri, Nov 4, 2016 at 3:15 PM, Eric V. Smith <e...@trueblade.com> > wrote: > >> Using PyParser_ASTFromS

Re: [Python-Dev] Parsing f-strings from PEP 498 -- Literal String Interpolation

2016-11-04 Thread Fabio Zadrozny
On Fri, Nov 4, 2016 at 3:15 PM, Eric V. Smith <e...@trueblade.com> wrote: > On 11/4/2016 10:50 AM, Fabio Zadrozny wrote: > >> In what way do you think the implementation isn't ready for a final >> release? >> >> >> Well, the cases listed in the do

Re: [Python-Dev] Parsing f-strings from PEP 498 -- Literal String Interpolation

2016-11-04 Thread Fabio Zadrozny
Answers inline... On Fri, Nov 4, 2016 at 5:56 AM, Eric V. Smith <e...@trueblade.com> wrote: > On 11/3/2016 3:06 PM, Fabio Zadrozny wrote: > >> Hi Python-Dev, >> >> I'm trying to get my head around on what's accepted in f-strings -- >> https://www.python.org

[Python-Dev] Parsing f-strings from PEP 498 -- Literal String Interpolation

2016-11-03 Thread Fabio Zadrozny
Hi Python-Dev, I'm trying to get my head around on what's accepted in f-strings -- https://www.python.org/dev/peps/pep-0498/ seems very light on the details on what it does accept as an expression and how things should actually be parsed (and the current implementation still doesn't seem to be in

Re: [Python-Dev] Avoiding CPython performance regressions

2015-12-01 Thread Fabio Zadrozny
On Mon, Nov 30, 2015 at 3:33 PM, Stewart, David C wrote: > > On 11/30/15, 5:52 AM, "Python-Dev on behalf of R. David Murray" > rdmur...@bitdance.com> wrote: > > > > >There's also an Intel project

Re: [Python-Dev] Avoiding CPython performance regressions

2015-12-01 Thread Fabio Zadrozny
and changed the second graph to compare the latest against the fastest version (2.7.rc11 vs 2.7.3) for the individual benchmarks. Best Regards, Fabio > > On Mon, Nov 30, 2015 at 3:52 PM, R. David Murray <rdmur...@bitdance.com> > wrote: > > On Mon, 30 Nov 2015 09:02:12

Re: [Python-Dev] Avoiding CPython performance regressions

2015-12-01 Thread Fabio Zadrozny
On Tue, Dec 1, 2015 at 8:14 AM, Maciej Fijalkowski <fij...@gmail.com> wrote: > On Tue, Dec 1, 2015 at 11:49 AM, Fabio Zadrozny <fabi...@gmail.com> wrote: > > > > On Tue, Dec 1, 2015 at 6:36 AM, Maciej Fijalkowski <fij...@gmail.com> > wrote: > >> >

Re: [Python-Dev] Avoiding CPython performance regressions

2015-12-01 Thread Fabio Zadrozny
On Tue, Dec 1, 2015 at 9:35 AM, Victor Stinner <victor.stin...@gmail.com> wrote: > 2015-12-01 10:49 GMT+01:00 Fabio Zadrozny <fabi...@gmail.com>: > > As for the graph, it should be easy to customize (and I'm open to > > suggestions). In the case, as it is, red is slow

[Python-Dev] Avoiding CPython performance regressions

2015-11-30 Thread Fabio Zadrozny
Hi python-dev, I've seen that on and off CPython had attempts to measure benchmarks over time to avoid performance regressions (i.e.: https://speed.python.org), but had nothing concrete so far, so, I ended up creating a hosted service for that (https://www.speedtin.com) and I'd like to help in

Re: [Python-Dev] Criticism of execfile() removal in Python3

2014-06-14 Thread Fabio Zadrozny
On Sat, Jun 14, 2014 at 6:00 PM, Markus Unterwaditzer mar...@unterwaditzer.net wrote: On Tue, Jun 10, 2014 at 05:23:12AM +0300, Paul Sokolovsky wrote: Hello, I was pleasantly surprised with the response to recent post about MicroPython implementation details

[Python-Dev] Python advanced debug support (update frame code)

2014-01-12 Thread Fabio Zadrozny
Hi Python-dev. I'm playing a bit on the concept on live-coding during a debug session and one of the most annoying things is that although I can reload the code for a function (using something close to xreload), it seems it's not possible to change the code for the current frame (i.e.: I need to

[Python-Dev] Test cases not garbage collected after run

2011-04-07 Thread Fabio Zadrozny
I actually created a bug entry for this (http://bugs.python.org/issue11798) and just later it occurred that I should've asked in the list first :) So, here's the text for opinions: Right now, when doing a test case, one must clear all the variables created in the test class, and I believe this

Re: [Python-Dev] nonlocal keyword in 2.x?

2009-10-22 Thread Fabio Zadrozny
On Wed, Oct 21, 2009 at 10:56 PM, Mike Krell mbk.li...@gmail.com wrote: Is there any possibility of backporting support for the nonlocal keyword into a  2.x release?  I see it's not in 2.6, but I don't know if that was an intentional design choice or due to a lack of demand / round tuits.  I'm

[Python-Dev] Cannot set PYTHONPATH with big paths with Python 3.0 and 3.1

2009-06-08 Thread Fabio Zadrozny
Hi all, I've reported bug http://bugs.python.org/issue5924 some time ago and I think it's a release blocker -- it seems easy to fix, but I don't have time to actually submit a patch, so, I'd like to draw attention to it, especially as a release candidate is already out. Cheers, Fabio

Re: [Python-Dev] Python 3.0 grammar ambiguous?

2009-03-09 Thread Fabio Zadrozny
To be honest I wasn't aware of this ambiguity. It seems that whoever wrote the patch for argument unpacking (a, b, *c = ...) got lucky with an ambiguous grammar. This surprises me, because IIRC usually pgen doesn't like ambiguities. Other parser generators usually have some way to deal with

[Python-Dev] Python 3.0 grammar ambiguous?

2009-03-08 Thread Fabio Zadrozny
Hi All, I'm trying to parse Python 3.0 following the Python 3.0 grammar from: http://svn.python.org/projects/python/branches/py3k/Grammar/Grammar Now, when getting to the arglist, it seems that the grammar is ambiguous, and I was wondering how does Python disambiguate that (I'll not put the

Re: [Python-Dev] Python 3.0 grammar ambiguous?

2009-03-08 Thread Fabio Zadrozny
I was wondering how does Python disambiguate that... anyone has any pointers on it? That is easy to answer: py parser.expr(f(*x)).totuple() (258, (326, (303, (304, (305, (306, (307, (309, (310, (311, (312, (313, (314, (315, (316, (317, (1, 'f')), (321, (7, '('), (329, (16, '*'), (303,

Re: [Python-Dev] Python 3.0 grammar ambiguous?

2009-03-08 Thread Fabio Zadrozny
To be honest I wasn't aware of this ambiguity. It seems that whoever wrote the patch for argument unpacking (a, b, *c = ...) got lucky with an ambiguous grammar. This surprises me, because IIRC usually pgen doesn't like ambiguities. Other parser generators usually have some way to deal with

Re: [Python-Dev] Can't have unbuffered text I/O in Python 3.0?

2008-12-21 Thread Fabio Zadrozny
It appears that this bug was already reported: http://bugs.python.org/issue4705 Any chance that it gets in the next 3.0.x bugfix release? Just as a note, if I do: sys.stdout._line_buffering = True, it also works, but doesn't seem right as it's accessing an internal attribute. Note 2: the

Re: [Python-Dev] Can't have unbuffered text I/O in Python 3.0?

2008-12-20 Thread Fabio Zadrozny
It appears that this bug was already reported: http://bugs.python.org/issue4705 Any chance that it gets in the next 3.0.x bugfix release? Just as a note, if I do: sys.stdout._line_buffering = True, it also works, but doesn't seem right as it's accessing an internal attribute. Note 2: the

[Python-Dev] Can't have unbuffered text I/O in Python 3.0?

2008-12-19 Thread Fabio Zadrozny
Hi, I'm currently having problems to get the output of Python 3.0 into the Eclipse console (integrating it into Pydev). The problem appears to be that stdout and stderr are not running unbuffered (even passing -u or trying to set PYTHONUNBUFFERED), and the content only appears to me when a

Re: [Python-Dev] Can't have unbuffered text I/O in Python 3.0?

2008-12-19 Thread Fabio Zadrozny
:43, Fabio Zadrozny fabi...@gmail.com wrote: Hi, I'm currently having problems to get the output of Python 3.0 into the Eclipse console (integrating it into Pydev). The problem appears to be that stdout and stderr are not running unbuffered (even passing -u or trying to set PYTHONUNBUFFERED

Re: [Python-Dev] Nonlocal shortcut

2008-12-07 Thread Fabio Zadrozny
I'm currently implementing a parser to handle Python 3.0, and one of the points I found conflicting with the grammar specification is the PEP 3104. It says that a shortcut would be added to Python 3.0 so that nonlocal x = 0 can be written. However, the latest grammar specification

Re: [Python-Dev] Changing a value in a frame (for a debugger)

2007-02-07 Thread Fabio Zadrozny
On 2/7/07, Greg Ewing [EMAIL PROTECTED] wrote: Fabio Zadrozny wrote: frame = findFrame(thread_id, frame_id) exec '%s=%s' % (attr, expression) in frame.f_globals, frame.f_locals The locals of a function are actually stored in an array. When you access them as a dict using locals(), all you

Re: [Python-Dev] Changing a value in a frame (for a debugger)

2007-02-07 Thread Fabio Zadrozny
On 2/7/07, Martin v. Löwis [EMAIL PROTECTED] wrote: Seriously, a feature request is likely to sit there forever. If you would come up with an actual patch, that would be a different thing. You'll likely answer your other question in the process of developing a patch, too. Ok... I've added

[Python-Dev] Changing a value in a frame (for a debugger)

2007-02-06 Thread Fabio Zadrozny
Hi All, I'm currently trying to change the value for a variable in the debugger using: frame = findFrame(thread_id, frame_id) exec '%s=%s' % (attr, expression) in frame.f_globals, frame.f_locals it works well when the frame for the change is the topmost frame, but fails otherwise... I found

[Python-Dev] New relative import issue

2006-09-17 Thread Fabio Zadrozny
I've been playing with the new features and there's one thing about the new relative import that I find a little strange and I'm not sure this was intended... When you do a from . import xxx, it will always fail if you're in a top-level module, and when executing any module, the directory of the

[Python-Dev] Grammar change in classdef

2006-09-16 Thread Fabio Zadrozny
I've been porting the grammar for pydev to version 2.5 and I've seen that you can now declare a class in the format: class B():pass (without the testlist) -- from the grammar: classdef: 'class' NAME ['(' [testlist] ')'] ':' suite I think that this change should be presented at

Re: [Python-Dev] Grammar change in classdef

2006-09-16 Thread Fabio Zadrozny
On 9/16/06, Lawrence Oluyede [EMAIL PROTECTED] wrote: I think that this change should be presented at http://docs.python.org/dev/whatsnew/whatsnew25.html It's already listed there: http://docs.python.org/dev/whatsnew/other-lang.html Thanks... also, I don't know if the empty yield statement

[Python-Dev] Import semantics

2006-06-11 Thread Fabio Zadrozny
Python and Jython import semantics differ on how sub-packages should be accessed after importing some module:Jython 2.1 on java1.5.0 (JIT: null)Type copyright, credits or license for more information. import xml xml.dommodule xml.dom at 10340434Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC