H. added the comment:
ImportError: No module named _weakrefset
Here are some references while i was trying to install Pinax framework.
http://paste.pound-python.org/show/6536/
And i saw that the _weakrefset.py is not included in the package. So I have
copied from Python's source with ve
New submission from Andreas H. :
The __eq__ method of ForwardRef does not take into account the module
parameter.
However, ForwardRefs with dissimilar module parameters are referring to
different types even if they have different name. Thus also the ForwardRef's
with same nam
Andreas H. added the comment:
I will give it a try.
--
___
Python tracker
<https://bugs.python.org/issue46333>
___
___
Python-bugs-list mailing list
Unsub
Andreas H. added the comment:
Yeah, sure. The use-case is (de)serialization. Right now I use the library
cattr, but there are many others.
If you are interested there is related discussion in the cattr board [1].
The original problem is how to define the types for serialization.
1. If
Andreas H. added the comment:
Ah, let me add one point: PEP563 (-> `from __future__ import annotations`) is
also not helping.
Even with PEP563 enabled, the JSON example
Json = Union[ List['Json'], Dict[str, 'Json'], int, float, bool, None ]
needs to be writte
New submission from Andreas H. :
Consider the following:
NewT = typing.NewType("NewT", typing.List[typing.Optional['Z']] )
class Z:
pass
Now get_type_hints() does not resolve the ForwardRef within NewType (but it
does so for TypedDict, dataclasses, Na
New submission from Andreas H. :
(De)Serialization of in-memory data structures is an important application.
However there is a rather unpleasant issue with ForwardRefs.
One cannot export type aliases when they contain ForwardRefs (and expect
things to work).
Consider the example
New submission from Andreas H. :
TypedDict does not resolve cross-module ForwardRefs when the ForwardRef is not
a direct one.
In other words the fix GH-27017 (issue 41249) for TypedDict seems incomplete.
The same issue seem to exist for NamedTuple.
Example:
#module.py
TD
Andreas H. added the comment:
Allright. B) sounds good to me. I dont think I have time today, so please feel
to tackle the issue. If not I can look at it the next week.
--
___
Python tracker
<https://bugs.python.org/issue46
Change by Andreas H. :
--
pull_requests: +29443
pull_request: https://github.com/python/cpython/pull/31283
___
Python tracker
<https://bugs.python.org/issue46
Andreas H. added the comment:
Inside the discussion an ExitPool class is sketched
(https://mail.python.org/archives/list/python-id...@python.org/message/66W55FRCYMYF73TVMDMWDLVIZK4ZDHPD/),
which provides this removal of context managers.
What I learned is that this would have different
Jonas H. added the comment:
Does that look good to you? If it does, I'll go on using the script
(http://paste.pocoo.org/show/396661/) on the 3.x docs.
--
keywords: +patch
Added file: http://bugs.python.org/file22164/p1.patch
___
Python tr
Jonas H. added the comment:
Linking a class using a function directive is counter-intuitive. That's why we
need to make use of class directives rather than function directives here.
--
___
Python tracker
<http://bugs.python.org/is
Jonas H. added the comment:
I'm not.
My patch doesn't address the problem of unlinkable methods but wrong type
declarations (read, wrong usage of ".. function::" directives) for builtins
like int, float, bool, list etc. Because the directives change, the roles used
to
Jonas H. added the comment:
> Could you make an effort to accept our word that using :class: instead of
> :func: would bring zero value to the indexing system nor to human readers?
I'm already doing; but I don't see anyone having made a good point against my
preference of
Jonas H. added the comment:
What's wrong with the changes I propose with the patch, then? Sorry, I really
don't get it, no matter how hard I try.
--
___
Python tracker
<http://bugs.python.o
Jonas H. added the comment:
> when you mark up something with a mod, func, class or meth role, Sphinx will
> find the target without paying attention to its type. So changing :func: to
> :class: does not bring anything.
>From a quick test this seems to hold true for links within
Jonas H. added the comment:
> So the intersphinx behavior is the "correct" one, but we can't change the
> other now because of compatibility.
Could you be convinced to use that legacy behaviour for intersphinx, too? :-)
--
_
Jonas H. added the comment:
> Jonas, I owe you an apology [...]
Thanks Éric, I got a bit worried about getting on your nerves...
Based on Ezio's idea: What happens if we have both a ".. function:: foo" and
".. class:: foo" -- where do :func:`foo` and :class:`f
Jonas H. added the comment:
Having one page with two objects of the same name, e.g.
.. function:: foo
.. class:: foo
renders to two entries with the same anchor name (#foo). The first entry gets a
link-to-this-paragraph marker, the second one doesn't.
Internal references (from w
New submission from Jonas H. :
I'd like to see an `examples` option added to argparse.ArgumentParser as found
in many man pages.
This could also be done using the `epilog` option, but that misses the
"%(proc)s" replacement which makes usage examples like this
Example usage:
Jonas H. added the comment:
Nope. I want an "examples" section, for example from `man git log`:
EXAMPLES
git log --no-merges
Show the whole commit history, but skip any merges
git log v2.6.12.. include/scsi drivers/scsi
Show all commits sin
New submission from Jonas H. :
from subprocess import Popen, PIPE
p = Popen(['ls'], stdout=PIPE)
p.wait()
p.stdout.seek(0)
Traceback (most recent call last):
File "t.py", line 5, in
p.stdout.seek(0)
IOError: [Errno 29] Illegal seek
Python 2.7.2, Arch Linu
Jonas H. added the comment:
Why does it have a 'seek' method then?
--
___
Python tracker
<http://bugs.python.org/issue12877>
___
___
Python-bugs-l
Changes by Jonas H. :
--
nosy: +jonash
___
Python tracker
<http://bugs.python.org/issue1731717>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Jonas H. :
Added file:
http://bugs.python.org/file20874/faster-find-library1-py3k-with-escaped-name.diff
___
Python tracker
<http://bugs.python.org/issue11
Jonas H. added the comment:
As far as I can tell, it doesn't matter.
We're looking for the part after the => in any case - ignoring the
ABI/architecture information - so the regex would chose the first of those
entries.
--
___
P
Jonas H. added the comment:
Humm. Would be great to have the `ldconfig -p` output of such a machine... I
can't get ldconfig to recognize 64-bit libraries on my 32-bit machines, so I
have no output to test against...
--
___
Python tracker
New submission from Jonas H. :
I guess this should be a link.
--
assignee: docs@python
components: Documentation
files: fix-json-link.diff
keywords: patch
messages: 129629
nosy: docs@python, jonash
priority: normal
severity: normal
status: open
title: Fix a link in library/json docs
Jonas H. added the comment:
> the orig impl matches the abi_type at the beginning of the parentheses,
> yours simply ignores the abi_type (that should have caught my eye, but that
> regex looked so much like magic that I didn't try to make sense of it :-))
Same here. :)
The vers
Jonas H. added the comment:
Here comes a patch, changing the behaviour to:
./python -q
>>> class C:
... pass
...
>>> (1).__class__ = 1
Traceback (most recent call last):
File "", line 1, in
TypeError: __class__ must be set to a class defined by a class stateme
New submission from Jonas H. :
Either a `BaseException.with_traceback` implementation is missing or the docs
are wrong.
http://docs.python.org/library/exceptions.html?highlight=with_traceback#exceptions.BaseException.with_traceback
python3 -c 'print("with_traceback" in di
Jonas H. added the comment:
*push* Any way to get this into the codebase?
--
___
Python tracker
<http://bugs.python.org/issue11258>
___
___
Python-bugs-list m
New submission from Jonas H. :
Intersphinx-ing of int, list, float, ... should work with ":class:`int`" (list,
float, ...). Also, intersphinx-ing list methods, e.g. ":meth:`list.insert`",
should work.
--
assignee: docs@python
components: Documentation
message
New submission from Jonas H. :
Provide a proper `list` method reference (like the one for `dict`,
http://docs.python.org/library/stdtypes.html#dict).
Right now, documentation about lists is spread over multiple topics (.rst
files) and methods are documented in footnotes.
Also, intersphinx
New submission from Jonas H. :
Various `int` attributes and methods seem undocumented (at least it does not
work to intersphinx them):
* .conjugate
* .denominator
* .imag
* .numerator
* .real
--
assignee: docs@python
components: Documentation
messages: 134926
nosy: docs@python, jonash
Jonas H. added the comment:
Actually I need to be able to intersphinx (because my documentation work is not
the Python docs :-) but I guess it boils down to the same problem of incomplete
Sphinx module/class indices.
--
___
Python tracker
<h
Jonas H. added the comment:
Indeed they do; but documentation writers need to know that `int()` and
`float()` are functions, which is counterintuitive. (and a CPython
implementation detail)
--
___
Python tracker
<http://bugs.python.org/issue11
Jonas H. added the comment:
> Is this a problem in our markup or a bug in intersphinx?
It's a markup problem -- those types are documented as functions, using the
:func: role/`.. func::` directive.
It's not only a markup mismatch but, strictly speaking, it's *wrong*
docum
Jonas H. added the comment:
It doesn't. Sphinx still can't make any links, which btw also means that it's
impossible to reference those methods within the Python documentation.
Also I want to point out that I find the information very hard to find as a
human. The fact that int
Jonas H. added the comment:
Shouldn't have used "decent" here, sorry. What I was trying to say is that
there's no "reference-like" documentation for the list datatype (as for dict).
There's more than enough quality documentation about lists but I think the
New submission from H Xu :
Build python 2.6.6 and python 2.7.1 on a NetBSD-5.1-sparc machine.
1. Run './configure';
2. Run 'make';
3. Run 'make install'.
There will be a problem after run 'make install'.
The last few lines of error messages are like
H Xu added the comment:
The result of 'make install SHELL="bash -x"' seems nothing different with the
"make install". Could there be any other way to debug?
--
___
Python tracker
<
New submission from Jonas H. :
(This applies to all versions of Python I investigated, although the attached
patch is for Python 2.7)
I wondered why `import uuid` took so long, so I did some profiling.
It turns out that `find_library` wastes at lot of time because of this crazy
regular
Changes by Jonas H. :
Added file: http://bugs.python.org/file20809/faster-find-library2.diff
___
Python tracker
<http://bugs.python.org/issue11258>
___
___
Python-bug
Jonas H. added the comment:
(might also be related to http://bugs.python.org/issue11063)
--
___
Python tracker
<http://bugs.python.org/issue11258>
___
___
Pytho
New submission from H Krishnan :
Named tuples and tuples have different creation behavior. Changing a tuple to a
namedtuple will involve changing the usage as well. For example:
>>> ntuple = collections.namedtuple("ntuple", "a,b")
>>> ntuple(1,2)
ntuple(a=
H Krishnan added the comment:
Sorry, I didn't know about "python-ideas".
Actually, there is a way to do this without breaking any existing code.
namedtuple could support an optional additional argument, say, useIterableCtr,
which is by default False, and the class te
Change by h-vetinari :
--
nosy: +h-vetinari
___
Python tracker
<https://bugs.python.org/issue46657>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Shmuel H. :
Currently, `dataclasses.dataclass` will generate `__init__` only where the user
has not defined one.
However, sometimes, with frozen classes or dataclasses with a lot of members,
redefinition of this function is not trivial,
especially if the only purpose is
Shmuel H. added the comment:
I think it was designed to. However, it is not very usable in production for a
number of reasons:
1. It won't work with frozen instances (you'll have to call
`object.__setattr__` directly).
2. It gets very messy with more than one or two `InitVar`s whic
Shmuel H. added the comment:
The only other solution I could think about was to change setattr's behaviour
dynamically so that it would be valid to call it from frozen instance's
`__init__`, but I think it is somehow even worst.
However, thanks for your help, I think we can clos
New submission from Ian H :
Currently there's no easy way to get at the internal cache of module spec
objects for compiled extension modules. See
https://github.com/python/cpython/blob/20ac34772aa9805ccbf082e700f2b033291ff5d2/Python/import.c#L401-L415.
For example, these module spec ob
New submission from Ian H :
Some of the import-related C API functions are documented as bypassing an
override to builtins.__import__. This appears to be the case, but the
documentation is incomplete in this regard. For example, PyImport_ImportModule
is implemented by calling PyImport_Import
New submission from Ian H :
While working on another project I noticed that there's a cache of shared
object handles kept inside _PyImport_FindSharedFuncptr. See
https://github.com/python/cpython/blob/b2b6cd00c6329426fc3b34700f2e22155b44168c/Python/dynload_shlib.c#L51-L55.
It appears
Ian H added the comment:
Proposed patch is in https://github.com/python/cpython/pull/25487.
--
___
Python tracker
<https://bugs.python.org/issue43895>
___
___
Change by Ian H :
--
keywords: +patch
pull_requests: +24282
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/25487
___
Python tracker
<https://bugs.python.org/issu
Change by h-vetinari :
--
nosy: +h-vetinari
___
Python tracker
<https://bugs.python.org/issue1635741>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by h-vetinari :
--
nosy: +h-vetinari
___
Python tracker
<https://bugs.python.org/issue40077>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by h-vetinari :
--
nosy: +h-vetinari
___
Python tracker
<https://bugs.python.org/issue39511>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by h-vetinari :
--
nosy: +h-vetinari
___
Python tracker
<https://bugs.python.org/issue40601>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by h-vetinari :
--
nosy: +h-vetinari
___
Python tracker
<https://bugs.python.org/issue15751>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by h-vetinari :
--
nosy: +h-vetinari
___
Python tracker
<https://bugs.python.org/issue40522>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Andreas H. :
The issue is that the main task (which was supplied to asyncio.run) has no
chance to clean up its "own" sub-tasks and handle
possible exceptions that occur during the sub-task clean up. It prevents a
graceful shutdown.
There is no way to prevent t
New submission from Andreas H. :
Currently it is not possible to remove context managers from an ExitStack (or
AsyncExitStack).
Workarounds are difficult and generally do accesses implementation details of
(Async)ExitStack.
See e.g. https://stackoverflow.com/a/37607405. It could be done as
Andreas H. added the comment:
I see your point. But even with `pop` or `remove` it is still a stack or
stack-like. In the normal case the context managers are still released in
reverse order as they were added. Order cannot be changed arbitrarily.
There is just the additional function of
New submission from Jonas H. :
re.match(p, ...) with a pre-compiled pattern p = re.compile(...) can be much
slower than calling p.match(...). Probably mostly in cases with "easy" patterns
and/or short strings.
The culprit is that re.match -> re._compile can spend a lot of time
Change by Jonas H. :
--
keywords: +patch
pull_requests: +27224
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/28936
___
Python tracker
<https://bugs.python.org/issu
Jonas H. added the comment:
I agree with your statement in principle. Here are numbers for the slowdown
that's introduced:
Without the change:
./python.exe -m timeit -s 'import re'\n'[re.compile(f"fill_cache{i}") for i
in range(512)]'\n'pat
Jonas H. added the comment:
pat.match() has 110 nsec.
Feel free to close the issue and PR if you think this isn't worth changing.
--
___
Python tracker
<https://bugs.python.org/is
Change by h-vetinari :
--
nosy: +h-vetinari
___
Python tracker
<https://bugs.python.org/issue44556>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Michael H :
https://docs.python.org/3/tutorial/introduction.html#strings
In the strings part of the basic tutorial, there is an output error regarding
the escaping of the single quote
>>> '"Isn\'t," they said.'
'"Isn\'t,&qu
Michael H added the comment:
Sorry, its my bad, it is correct as it is, I hadn't read further on about the
print statement being needed. As I am working through the tutorial in pycharm,
I am had already used print statement.
T
Michael H added the comment:
Many thanks!
--
___
Python tracker
<https://bugs.python.org/issue38779>
___
___
Python-bugs-list mailing list
Unsubscribe:
h-vetinari added the comment:
Hey Terry
I had asked about this on discuss
(https://discuss.python.org/t/toolchain-upgrade-on-windows/6377/2), and Steve
provided some very valuable input.
In particular, building with the newer VS (that supports C11) should stay
ABI-compatible with
h-vetinari added the comment:
PS.
> Judging from the link you posted to version numbering
https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering
the first line should have 'MSVC 14.28' the middle column title should be 'MS
Visual Studio
h-vetinari added the comment:
PPS. Also, the compiler implementation reference uses 19.x for MSVC:
https://en.cppreference.com/w/cpp/compiler_support, which was the link I was
trying to make, now that I'm looking at it.
--
___
Python tr
Change by h-vetinari :
--
nosy: +h-vetinari
___
Python tracker
<https://bugs.python.org/issue43112>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Julien H :
--
components: +Library (Lib) -Demos and Tools
versions: -Python 3.9
___
Python tracker
<https://bugs.python.org/issue41030>
___
___
Pytho
Change by Julien H :
--
title: Provide toList() method on iterators (`list()` is a flow killer in REPL)
-> Provide toList() method on iterators/generators (`list()` is a flow killer
in REPL)
___
Python tracker
<https://bugs.python.org/issu
Julien H added the comment:
Hello Ammar Askar,
I agree `_` avoids the "up arrow" problem I mentioned in the REPL.
I actually primarily use jupyter notebooks in my work.
Point 1. in my first message is the primary issue. Having to edit the line in
two places to perform one
New submission from Natsumi H. :
I suggest adding a function which behaves like map but without returning
anything to iterate over a generator.
This is useful in cases where you need to run a function on every element in a
list without unnecessarily creating a generator object like map would
Natsumi H. added the comment:
Exactly that was the plan!
--
___
Python tracker
<https://bugs.python.org/issue41107>
___
___
Python-bugs-list mailing list
Unsub
Natsumi H. added the comment:
If it won't be added do you reckon creating a library to solve this issue would
be appropriate?
--
___
Python tracker
<https://bugs.python.org/is
New submission from Tomek H :
With Python3.9 there is a great feature for merging `dict`s:
{1: 'a'} | {2: 'b'} => {1: 'a', 2: 'b'}
It would be very handy to filter out a dict with a similar fashion (for example
& operator with a list/tuple/froz
New submission from h-vetinari :
While Visual Studio 16.8 (<-> MSVC 19.28) has _just_ been released, I think it
would be worthwhile to consider upgrading the compiler toolchain that's used to
build the CPython windows binaries, particularly before the release of 3.10.
That
New submission from H Xu :
The `repr()` built-in function link in this page [
http://docs.python.org/library/functions.html ] should link to the built-in
version of `repr()`.
It should link to: http://docs.python.org/library/functions.html#repr
However, it links to here: http
Changes by Christian H :
--
nosy: +Christian H
___
Python tracker
<http://bugs.python.org/issue1615158>
___
___
Python-bugs-list mailing list
Unsubscribe:
Christian H added the comment:
I was also bitten by this bug, and would like to see it merged. The patch
22536-subprocess-exception-filename-2.patch looks fine to me.
--
nosy: +Christian H
___
Python tracker
<http://bugs.python.org/issue22
Marcel H added the comment:
I want to see this fixed in python3.x as well, please :) the patch should be
the same
--
nosy: +Marcel H2
versions: +Python 3.6, Python 3.7
___
Python tracker
<http://bugs.python.org/issue14
New submission from Jonas H. :
Use case: Try to get a future's result using
concurrent.futures.Future.result(), and log the full exception if there was any.
Currently, only "excinst" (sys.exc_info()[1]) is provided with the
Future.exception() method.
Proposal: Add new
Jonas H. added the comment:
See also
https://stackoverflow.com/questions/19309514/getting-original-line-number-for-exception-in-concurrent-futures
for other people having the same problem
--
___
Python tracker
<https://bugs.python.org/issue32
Jonas H. added the comment:
This affects me too.
--
nosy: +jonash
___
Python tracker
<https://bugs.python.org/issue31526>
___
___
Python-bugs-list mailin
New submission from Jonas H. :
I'd like to add test selection based on parts of the test class/method name to
unittest. Similar to py.test's "-k" option:
https://docs.pytest.org/en/latest/example/markers.html#using-k-expr-to-select-tests-based-on-their-name
Here&
Jonas H. added the comment:
Just to be clear, the current implementation is limited to substring matches.
It doesn't support py.test like "and/or" combinators. (Actually, py.test uses
'eval' to support arbitrary patterns.)
So say we have test case
SomeClass
te
Jonas H. added the comment:
Thanks Antoine. I will need some guidance as to what are the correct places to
make these changes. I'm not quite sure about the abstractions here (runner,
loader, suite, case, etc.)
My PoC (see GitHub link in first post) uses a TestSuite subclass. (The sub
Jonas H. added the comment:
> > 3) Is the approach of dynamically wrapping 'skip()' around to-be-skipped
> > test cases OK?
> I think this is the wrong approach. A test that isn't selected shouldn't be
> skipped, it should not appear in the output at al
Jonas H. added the comment:
Interesting, Victor. I've had a look at the code you mentioned, but I'm afraid
it doesn't really make sense to re-use any of the code.
Here's a new patch, implemented in the loader as suggested by Antoine, and with
tests.
I'm happy t
Jonas H. added the comment:
Sure!
--
___
Python tracker
<https://bugs.python.org/issue32071>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.pyth
Jonas H. added the comment:
Ah, the problem isn't that it's running getattr() on test methods, but that it
runs getattr() on all methods.
Former code: attrname.startswith(prefix) and \
callable(getattr(testCaseClass, attrname))
New code: testFunc = getattr(tes
1 - 100 of 177 matches
Mail list logo