Gabriele N Tornetta added the comment:
code.co_qualname was introduced in 2021 with bpo-44530 and shuold give the same
guarantees as code.co_name. The __qualname__ attribute is derived from
code.co_qualname, so perhaps Cython can benefit from accessing code.co_qualname
directly instead
Change by Gabriele N Tornetta :
--
keywords: +patch
pull_requests: +29327
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31150
___
Python tracker
<https://bugs.python.org/issu
New submission from Gabriele N Tornetta :
https://bugs.python.org/issue44530 introduced the co_qualname field to code
objects. This could be used to, e.g. enrich the information provided by
tracebacks. Consider this simple example
~~~ python
import traceback
class Bogus:
def __init__
Gabriele N Tornetta added the comment:
Thanks for mentioning that issue, it didn't come up in my search for a similar
one. Indeed, with the proposals in bpo-15500 implemented, and the fact that
native_thread_id is already in PyThreadState, retrieving the name should be
easy and might
Change by Gabriele N Tornetta :
--
keywords: +patch
pull_requests: +29319
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31142
___
Python tracker
<https://bugs.python.org/issu
New submission from Gabriele N Tornetta :
For tools like Austin (https://github.com/P403n1x87/austin) it is currently
quite challenging to derive the name of a thread based on the information
exposed by the PyThreadState structure and one stored in threading._active. I
would like to propose
Gabriele N Tornetta added the comment:
@rhettinger
Apologies. You're totally right but I wasn't expecting this to become a lengthy
conversation.
So, to get closer to the initial issue, I believe that this ticket could be
closed provided that the documentation is improved
Gabriele N Tornetta added the comment:
> Python is very much a language about responsibility. If Django is overriding
> `__getattribute__` then it is their responsibility to ensure that everything
> still works properly.
Perhaps I didn't stress observability enough. A tool li
Gabriele N Tornetta added the comment:
> I tend to agree with Steven and David here. You define __getattribute__ and
> so that's the behaviour you get when an attribute of the class is requested
> (whether by the system or by your code).
I would agree if it was obvious or exp
Gabriele N Tornetta added the comment:
I think the issue on display here is that isinstance could cause a side effect,
which I dare say it's unexpected (and not documented AFAIK). Are there any
reasons why __class__ cannot be retrieved with object.__getattribute__ instead?
In
Gabriele N Tornetta added the comment:
The following example shows isinstance causing a side effect
class Side:
class Effect(Exception):
pass
def __getattribute__(self, name):
raise Side.Effect()
isinstance(Side(), str)
I'd be inclined to see this as a bug
Gabriele N Tornetta added the comment:
That's totally fine. My aim is to have something in place that would make
preloading some code less clunky than what it is just now.
--
___
Python tracker
<https://bugs.python.org/is
Gabriele N Tornetta added the comment:
@christian.heimes thanks for bringing PEP 648 to my attention. The solution
proposed there would work for me, although it actually does a bit more with
some extra complexity. Not a big issue though.
@eric.smith I think that, as argued in PEP 648, pth
Change by Gabriele N Tornetta :
--
keywords: +patch
pull_requests: +27235
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/28946
___
Python tracker
<https://bugs.python.org/issu
New submission from Gabriele N Tornetta :
I would like to propose adding support for preloading a Python script before
executing a Python application.
Potential design:
A new environment variable (e.g. PY_PRELOAD, an allusion to LD_PRELOAD, or
PYTHONPRELOAD to be more aligned with the
Gabriele N Tornetta added the comment:
With commit 7a12d31a8c22cae7a9c1a2239a1bb54adee33622 the new figures are
# main (7569c0fe91): 25_059_438 bytes
# bpo-445303-code-qualname (7a12d31a8c): 25_089_917 bytes
which is a 0.1% relative increase :). This is likely due to the fact that with
the
Gabriele N Tornetta added the comment:
> That is a pointer size per code object. The most standard way is to calculate
> the size of all pyc files in the stdlib after compiling them all with "-m
> compileall -r 1000 Lib".
This yields the following numbers between w
Gabriele N Tornetta added the comment:
@pablogsal
Commit a0252ab9add7d48e9e0604ebf97342e46cf00419 exposes co_qualname to Python.
I've added a test case to check that the result coincides with the current
implementation of __qualname__. Is there a "standard" way for me t
Gabriele N Tornetta added the comment:
Thanks for the feedback. I certainly appreciate all the concerns around this
proposed change.
@Mark.Shannon
1. This is the desired behaviour as profiling data should be attached to the
actual code objects that correlate with the actual source content
Change by Gabriele N Tornetta :
--
keywords: +patch
pull_requests: +25508
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/26941
___
Python tracker
<https://bugs.python.org/issu
New submission from Gabriele N Tornetta :
When dumping profiling data out of code objects using out-of-process tools like
Austin (https://github.com/p403n1x87/austin) one has access only to file name,
function name, and line number. Consider the flame graph generated by running
the following
Gabriele N Tornetta added the comment:
I think I managed to find the source of the confusion. This seems to be due to
https://github.com/python/cpython/commit/fcb55c0037baab6f98f91ee38ce84b6f874f034a,
with the f_lasti from the C struct now being half of the value returned by the
f_lasti
Change by Gabriele N Tornetta :
--
title: bytecode<>line number mapping seems wrong in 3.10.0b2 -> bytecode<>line
number mapping and f_lasti seem wrong in 3.10.0b2
___
Python tracker
<https://bugs.pyt
New submission from Gabriele N Tornetta :
I was looking at how the new co_linetable works in order to add initial support
for Python 3.10 to Austin (https://github.com/P403n1x87/austin) when I stumbled
upon the following interesting output from the dis module. I am using the
following test
Change by Gabriele N Tornetta :
--
keywords: +patch
pull_requests: +24297
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/25577
___
Python tracker
<https://bugs.python.org/issu
New submission from Gabriele N Tornetta :
When Python is embedded in other applications, it is not easy to determine
which version of Python is being used. This change exposes the Python version
as part of the API data. Tools like Austin
(https://github.com/P403n1x87/austin) can benefit from
Change by Gabriele N Tornetta :
--
title: Add native_id to PyThreadState -> Add native_thread_id to PyThreadState
___
Python tracker
<https://bugs.python.org/issu
New submission from Gabriele Tornetta :
I would like to propose adding the native_id field to the PyThreadState
structure to store the result of PyThread_get_thread_native_id. On some
systems, like Linux, it is not easy to retrieve this information from outside
of the Python interpreter
Gabriele Tornetta added the comment:
That makes sense, but I wonder what the "right" behaviour should be in this
case. Surely the infinite recursion should be fixed at the very minimum.
Perhaps the code on Windows could be enhanced to catch the case whereby one is
trying to dele
New submission from Gabriele Tornetta :
The following script causes havoc on Windows while it works as expected on
Linux
~~~ python
import os
import tempfile
def test_chdir():
with tempfile.TemporaryDirectory() as tempdir:
os.chdir(tempdir)
~~~
Running the above on Windows
New submission from Gabriele Tornetta :
def outer():
a=set()
def inner():
a |= set(["A"])
inner()
return a
print(outer())
Traceback (most recent call last):
File "main.py", line 8, in
print(outer())
File "main.py", line 5, in outer
inner(
Gabriele added the comment:
Hi Eric,
I think is a bug and not a simple coding error.
python is adding new value into another key in a dictionary when the key is not
called.
I updated my code (check "programTEST.py") that can replicate perfectly my
problem.
Please try my program
Change by Gabriele :
Added file: https://bugs.python.org/file48760/programTEST.py
___
Python tracker
<https://bugs.python.org/issue38984>
___
___
Python-bugs-list mailin
New submission from Gabriele :
hello,
I found this strange issue in my program:
I’m reading a file with 5 columns separated by ‘;’ . Columns 3,4 and 5 can have
multiple values and in this case, are separated by ‘,’ .
Some values in column 3 can be repeated in each line in the same column
Gabriele Tornetta added the comment:
Are there any PRs already for this issue? I couldn't find any on GitHub. Also,
is the plan to branch the fix down to at least 3.6?
--
nosy: +Gabriele Tornetta
___
Python tracker
<https://bugs.py
New submission from Gabriele Tornetta :
When trying to install a module (pycrypto in this case), easy_install fails
with the following error (run via Git Bash)
$ easy_install pycrypto-2.6.win-amd64-py3.3.exe
Processing pycrypto-2.6.win-amd64-py3.3.exe
error: [WinError 32] The process cannot
36 matches
Mail list logo