Rémi Lapeyre added the comment:
Hi wyz23x2, did you do that from a clean interpreter?
_ is set to the last non-None result:
https://github.com/python/cpython/blob/dd8a93e23b5c4f9290e1cea6183d97eb9b5e61c0/Python/sysmodule.c#L690-L696
So what you are seeing is that (None and True) is None, but
Rémi Lapeyre added the comment:
This behaviour is documented at
https://docs.python.org/3/library/sys.html#sys.displayhook.
--
___
Python tracker
<https://bugs.python.org/issue41
Rémi Lapeyre added the comment:
Hi, can you not use its repr:
>>> try: raise ValueError
... except Exception as e: print(f"Following happened: {e!r}")
...
Following happened: ValueError()
?
--
nosy: +remi.lapeyre
___
Pyt
Change by Rémi Lapeyre :
--
nosy: +remi.lapeyre
versions: +Python 3.10, Python 3.9
___
Python tracker
<https://bugs.python.org/issue41485>
___
___
Python-bug
Rémi Lapeyre added the comment:
This is a known issue and I have a PR that does this that I could post but it
was rejected when it was previously discussed:
https://bugs.python.org/issue23229#msg233963
--
___
Python tracker
<ht
Rémi Lapeyre added the comment:
> That's a solution, except you must know ahead of time this issue exists.
If we changed str(e) to make it the same as repr(e), there would be no way to
get only the message. str(e) returns the message so if the message given was
empty (or no message w
Rémi Lapeyre added the comment:
This is a duplicate of 21041, it would be better to change the title of your PR
so that it points to this bug report and to continue the discussion there.
--
nosy: +remi.lapeyre
versions: -Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9
Rémi Lapeyre added the comment:
*This is a duplicate of issue 21041
--
___
Python tracker
<https://bugs.python.org/issue41511>
___
___
Python-bugs-list mailin
Rémi Lapeyre added the comment:
> The question then is: is there any way for the uuid module to recognize and
> ignore such interfaces other than by the hardcoded MAC address?
Could uuid1 xor all mac addresses on MacOS? The result would be deterministic
and unique as long as there
Change by Rémi Lapeyre :
--
keywords: +patch
pull_requests: +13353
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36906>
___
___
Py
Rémi Lapeyre added the comment:
Hi @steven.daprano, @gregory.p.smith. I added the first version of my PR for
review.
One issue with it is that in:
def f():
return " foo".dedent()
f will have both " foo" and "foo" in its constants even if the first is
Rémi Lapeyre added the comment:
> Serhiy's message crossed with mine.
And mine crossed with yours, sorry. I will update my PR shortly.
--
___
Python tracker
<https://bugs.python.org
Rémi Lapeyre added the comment:
> Perform the optimization at the AST level, not in the peepholer.
Thanks, this makes more sense.
--
___
Python tracker
<https://bugs.python.org/issu
Rémi Lapeyre added the comment:
Thanks @serhiy.storchaka, it's far easier to do here. I pushed the patch to the
attached PR. Is there a reason the other optimisations in the Peephole
optimizer are not done in the AST?
--
___
Python tracker
&
Change by Rémi Lapeyre :
--
keywords: +patch
pull_requests: +13361
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36969>
___
___
Py
Rémi Lapeyre added the comment:
> Rémi, could you do a PR addressing co_posonlyargcount?
Of course, should I open a new PR or post a patch to be added to a current PR?
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issu
Change by Rémi Lapeyre :
Added file: https://bugs.python.org/file48343/file0.txt
___
Python tracker
<https://bugs.python.org/issue36975>
___
___
Python-bugs-list mailin
Change by Rémi Lapeyre :
Added file: https://bugs.python.org/file48342/csv_parser.py
___
Python tracker
<https://bugs.python.org/issue36975>
___
___
Python-bugs-list m
Change by Rémi Lapeyre :
Added file: https://bugs.python.org/file48344/file1.txt
___
Python tracker
<https://bugs.python.org/issue36975>
___
___
Python-bugs-list mailin
Rémi Lapeyre added the comment:
I don't understand the issue here, csv can raise many errors when an issue
happens:
>>> import csv
>>> csv.reader(None)
Traceback (most recent call last):
File "", line 1, in
TypeError: argument 1 must be an iterator
Wh
Change by Rémi Lapeyre :
--
pull_requests: +13369
___
Python tracker
<https://bugs.python.org/issue36969>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Rémi Lapeyre :
--
title: pdb: do_args: display/handle keyword-only arguments -> pdb.do_args:
display keyword-only and positional only arguments
___
Python tracker
<https://bugs.python.org/issu
Rémi Lapeyre added the comment:
I don't think all errors can be documented, csv iterate over the object but has
no idea what it is. When writing for example, anything could happen, from a
socket timing out, permissions errors, the underlying media being removed not
properly, the media h
Rémi Lapeyre added the comment:
Hi Jess, are you still working on this?
--
___
Python tracker
<https://bugs.python.org/issue36230>
___
___
Python-bugs-list mailin
Change by Rémi Lapeyre :
--
keywords: +patch
pull_requests: +13413
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue37011>
___
___
Py
Rémi Lapeyre added the comment:
Hi @blueyed, can you confirm PR 13497 solve your issue ?
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue37
Rémi Lapeyre added the comment:
Hi @vykouk, Python evaluates arguments before calling functions so
>>> dicti.get(key, dflt(key))
is equivalent to:
>>> arg = dflt(key)
>>> dicti.get(key, arg)
Notive how dflt() is called before .get()
This is how all functions wo
Rémi Lapeyre added the comment:
Hi Daniel, this is indeed unexpected, I don't see how to have a better patch
since the fact that _getval() raise an exception is used in do_source() and
do_whatis().
Could you convert your patch as a PR and add a test?
--
nosy: +remi.la
Rémi Lapeyre added the comment:
This part of the code is already used in three places and your patch would add
two occurrences of of it, I think it would be great to put the part that print
the exception in a private method, to avoid duplicating it all over the place.
Doing this seems small
Rémi Lapeyre added the comment:
Hi Steven, thanks for taking the time to reviewing my patch.
Regarding the relevance of add select(), I was looking for work to do in the
bug tracker and found some references to it
(https://bugs.python.org/issue21592#msg219934 for example).
I knew that there
Rémi Lapeyre added the comment:
I think it could be done with `key=lambda item: -item` if the key argument is
added.
--
___
Python tracker
<https://bugs.python.org/issue4
Rémi Lapeyre added the comment:
Can you not use functools.cmp_to_key() for this?
Here's an example:
>>> import bisect, functools
>>> l = [('f', 5), ('d', 3), ('c', 2), ('b', 1), ('a', 0)]
>>> def
Change by Rémi Lapeyre :
--
versions: +Python 3.9
___
Python tracker
<https://bugs.python.org/issue4356>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Rémi Lapeyre :
Issue 33164 (commit 51aa35e9e17eef60d04add9619fe2a7eb938358c) introduced
numerous new warnings on MacOS:
/Users/remi/src/cpython/Modules/_blake2/impl/blake2b.c:192:9: warning:
'blake2b_init' macro redefined
[-Wmacro-redefined]
#define bl
Rémi Lapeyre added the comment:
> The proposed change is not backward compatible.
Indeed, I missed that thanks. I think I could fix that.
> A motivation for this change should be provided first
Is getting accurate coverage reports not
Change by Rémi Lapeyre :
--
keywords: +patch
pull_requests: +13500
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/13593
___
Python tracker
<https://bugs.python.org/issu
Rémi Lapeyre added the comment:
With the attached PR, the error message is now:
>>> def f(): pass
...
>>> code = f.__code__
>>> code.replace(co_lnotab=4)
Traceback (most recent call last):
File "", line 1, in
TypeError: replace() argument 'co_lnota
Rémi Lapeyre added the comment:
Hi, I'm working on a PR. It should be ready in a couple of days. It's more
involved than what I thought as to avoid importing inspect during compilation I
will probably need to port cleandoc() in C.
--
nosy: +re
Rémi Lapeyre added the comment:
It will be done automatically after someone validated the PR.
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue37
Rémi Lapeyre added the comment:
This is the function I inlined and as far as I can tell, my approach as been
similar to the one you linked.
I'm still need to fix some issues as doctest was expecting to find the string
before dedenting t
Rémi Lapeyre added the comment:
> IMO we should at most clarify in the docs.
This makes sense, I will update my PR tomorrow.
--
___
Python tracker
<https://bugs.python.org/issu
Change by Rémi Lapeyre :
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue32884>
___
___
Python-bugs-list mailing list
Unsubscribe:
Rémi Lapeyre added the comment:
Hi rathinavelu thiruvenkatam, cPython has some optimizations where some
immutable constants will be folded in the same object to save memory so this is
not a bug, it's just that those optimization are not run when typing directly
in the shell.
You should
Rémi Lapeyre added the comment:
Hi Su Zhu, this is expected, as per the documentation, filter returns an
iterable and not a list. The first `list(a)` consumes the iterable so it is
empty when doing the second `list(a)`. You can see the same behavior when
creating an iterable manually:
>&
Change by Rémi Lapeyre :
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue33997>
___
___
Python-bugs-list mailing list
Unsubscribe:
Rémi Lapeyre added the comment:
Hi, I got bit by this bug last week, I wrote an example that reproduce the
basic idea of our program main loop and it hangs
- around 20% of the time with a release build of Python 3.7.4
- around 6% of the time with a debug build of Python 3.7, 3.8 and 3.9
Change by Rémi Lapeyre :
--
components: +Library (Lib) -Windows
___
Python tracker
<https://bugs.python.org/issue33997>
___
___
Python-bugs-list mailing list
Unsub
Rémi Lapeyre added the comment:
Removed Python 3.6 as it is in security fixes now.
--
versions: +Python 3.8, Python 3.9 -Python 3.6
Added file: https://bugs.python.org/file48532/test_multiprocessing.py
___
Python tracker
<https://bugs.python.
Change by Rémi Lapeyre :
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue35227>
___
___
Python-bugs-list mailing list
Unsubscribe:
Rémi Lapeyre added the comment:
Adding this API would require to provide a way to set file status like mode,
uid, gid, mtime, type, linkname, uname and gname.
Adding a new argument to gettarinfo looks weird to me, adding a new method may
be better. I will try to propose a working
Rémi Lapeyre added the comment:
Yes, but in the same way that there is the add method to conveniently build the
TarInfo object for the user, shouldn't we provide a new convenience method to
TarFile to support this (in addition to modifying Ta
Change by Rémi Lapeyre :
--
keywords: +patch
pull_requests: +9963
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35227>
___
___
Py
Rémi Lapeyre added the comment:
Hi @mgorny, the changeset in PR 10714 should do what you are looking for.
--
___
Python tracker
<https://bugs.python.org/issue35
Rémi Lapeyre added the comment:
Did you notice that `skipped 'Not supported'` will be displayed once per
skipped subtest so changing your `for i in range(1, 3):` by `for i in range(1,
5):` will show:
python3 -m unittest -v
test_something (test2.SomeTest) ... skipped
Rémi Lapeyre added the comment:
I think this is a nice output, taking a quick look at unittest source, all the
information needed to display this is save in the TestResult object, showing
skipped tests is done here:
https://github.com/python/cpython/blob/master/Lib/unittest/runner.py#L85
It
Rémi Lapeyre added the comment:
I came across this thread while working on the PR, creating tarinfo as Lars
Gustäbel suggests does not work since you still need to get the size before
reading.
Do you think the API should be different
Rémi Lapeyre added the comment:
The intersection of an empty set of sets is either the empty set or the
universe sets so if set.union() is defined to support set.union(*sequence),
wouldn't it be less surprising for set.intersection() to return the empty set
too?
--
Rémi Lapeyre added the comment:
Thanks, this looks interesting.
How will the file writer know the whole file has been read? The override of the
Tar header is done on `close`?
Are `download_tarinfo` and `svgz_tarinfo` built by hand if we don't make
changes in `getta
Change by Rémi Lapeyre :
--
keywords: +patch, patch
pull_requests: +10682, 10683
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Rémi Lapeyre :
--
keywords: +patch
pull_requests: +10682
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35540>
___
___
Py
Change by Rémi Lapeyre :
--
keywords: +patch, patch, patch
pull_requests: +10682, 10683, 10684
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Rémi Lapeyre added the comment:
Hi @wrmsr, this happens because the constructor for `collections.defaultdict`
differs from the one of `dict`.
I think the argument that collections.defaultdict is in the stdlib and should
be supported is right, the changes in PR #11361 should do what you want
Change by Rémi Lapeyre :
--
keywords: +patch
pull_requests: +10710
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35232>
___
___
Py
Change by Rémi Lapeyre :
--
keywords: +patch, patch
pull_requests: +10710, 10711
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Rémi Lapeyre added the comment:
Hi @Anthony.Lee, the __module__ is wrong indeed. The new changeset in
https://github.com/python/cpython/pull/11371 should implement what you need.
If you don't specify the new `module` and `qualname` parameters,
make_dataclass() will try to determin
Rémi Lapeyre added the comment:
@serhiy.storchaka, it should be possible to make it far simpler if we make
math_prod_impl more naive by removing the hypothesis made on `iterable` and the
many fast-paths like builtin_sum_impl() does when SLOW_SUM is defined, right?
A naive implementation
Rémi Lapeyre added the comment:
Hi, I think this is indeed a bug, `copy()` is expected to succeed. I was able
to reproduce the issue in an interpreter but did not succeed to write a test
case that triggers the race-condition.
I think the fix you suggested is the right solution
Rémi Lapeyre added the comment:
Hi, thanks for opening a bug report. Can you provide a script that reproduce
the issue?
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue35
Rémi Lapeyre added the comment:
I just tried your script in "9a3ffc" (3.7.2final) and "260ec2c36a" (3.7.1final)
and it worked on both without halting the main process.
I'm on MacOS Sierra, can you give more details about your environment?
-
Rémi Lapeyre added the comment:
>I think we should also consider changing the type creation behaviour in 3.8
@ncoghlan is this what's being done in PyTypeReady?
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org
Rémi Lapeyre added the comment:
Weirdly enough, it works with iPython:
$ ipython3
Python 3.7.1 (default, Nov 6 2018, 18:49:54)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type
Rémi Lapeyre added the comment:
Hi @rhettinger, this is similar to #33474.
I started working on an implementation of this.
With the implementation you propose, if a field has both init=True and
frozen=True, it may be set after the creation of the instance:
@dataclass
class
Rémi Lapeyre added the comment:
Is there a problem with:
from unittest import mock
class SomeClass:
def do_something(self, x):
pass
def some_function(x):
obj = SomeClass()
y = obj.do_something(x)
return y
def do_something_side_effect(self, x):
print(self
Rémi Lapeyre added the comment:
I prepared a patch to make the check when there is only one dict, it may be the
less surprising change.
BTW, I got lost when looking for the root cause of this change because
grepping for the error message did not work as it has line breaks
Rémi Lapeyre added the comment:
I believe that this is similar to https://bugs.python.org/issue35378 on which
@pablogsal is working.
You were right, the issue steems from a refcount bug. Until the resolution you
can avoid the issue by explictly keeping a reference on the pool:
>>&g
Change by Rémi Lapeyre :
--
nosy: +pablogsal
___
Python tracker
<https://bugs.python.org/issue35629>
___
___
Python-bugs-list mailing list
Unsubscribe:
Rémi Lapeyre added the comment:
> I also removed myself from the issue, I'm not interested to implement it.
I would like to try and implement the change. I will open a PR shortly.
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs
Change by Rémi Lapeyre :
--
keywords: +patch
pull_requests: +10987
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/iss
Change by Rémi Lapeyre :
--
keywords: +patch, patch
pull_requests: +10987, 10988
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/iss
Change by Rémi Lapeyre :
--
keywords: +patch, patch, patch
pull_requests: +10987, 10988, 10989
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/iss
Rémi Lapeyre added the comment:
I made a first proposal for this feature in PR 11478, I had to adapt
argparse.Action to customize how the action is represented in the usage string
by adding a format_usage() method that would default to the current behavior if
not overridden.
Other methods
Rémi Lapeyre added the comment:
What do you think median([1, 1.0]) should return?
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue35
Change by Rémi Lapeyre :
--
keywords: +patch
pull_requests: +10996
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue35397>
___
___
Py
Change by Rémi Lapeyre :
--
keywords: +patch, patch
pull_requests: +10996, 10997
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Rémi Lapeyre :
--
keywords: +patch, patch, patch
pull_requests: +10996, 10997, 10998
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Rémi Lapeyre added the comment:
> As a secondary school student, knowing the definition of median, I might
> expect the value to be 2, for any n > 0.
The secondary school student would be wrong, wouldn't he?
The median of a set is not expected to be a part of the set. Especi
Rémi Lapeyre added the comment:
time.sleep() is probably not the only function to have such a bug.
Maybe __int__() should default to:
def __int__(self):
return int(self.__float__())
when __float__ is defined and not __int__.
Nick Coghlan suggested something similar for __int__
Change by Rémi Lapeyre :
--
nosy: +ncoghlan
___
Python tracker
<https://bugs.python.org/issue35707>
___
___
Python-bugs-list mailing list
Unsubscribe:
Rémi Lapeyre added the comment:
See #33039 for the proposed change to __int__.
--
___
Python tracker
<https://bugs.python.org/issue35707>
___
___
Python-bug
Rémi Lapeyre added the comment:
This does not do what you want:
>>> class MyInt(int): pass
>>> wibble(MyInt(4), MyInt(2))
2.0
and a patch is only needed if something is broken.
I'm with vstinner of the opinion that nothing is broken and vo
New submission from Rémi Lapeyre :
When creating a class, I sometimes wish to get this behavior:
def MyClass:
def __init__(self, param):
self._param = param
def __repr__(self):
return f"MyClass(param={self._param})"
Unless I'm mak
Rémi Lapeyre added the comment:
The off-by-one error in a test added for an unrelated issue (#17467) makes me
think @michael.foord just made a mistake in the test.
> mock_open docs mentions about using a customized mock for complex cases
I think it's more for complex things like fetch
Change by Rémi Lapeyre :
--
keywords: +patch
pull_requests: +11098
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue31855>
___
___
Py
Change by Rémi Lapeyre :
--
keywords: +patch, patch
pull_requests: +11098, 11099
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Rémi Lapeyre :
--
keywords: +patch, patch, patch
pull_requests: +11098, 11099, 11100
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Rémi Lapeyre :
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue27015>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Rémi Lapeyre :
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue35717>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Rémi Lapeyre :
--
pull_requests: +11101
___
Python tracker
<https://bugs.python.org/issue17467>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Rémi Lapeyre :
--
pull_requests: +11101, 11102
___
Python tracker
<https://bugs.python.org/issue17467>
___
___
Python-bugs-list mailing list
Unsub
Change by Rémi Lapeyre :
--
pull_requests: +11101, 11102, 11103
___
Python tracker
<https://bugs.python.org/issue17467>
___
___
Python-bugs-list mailing list
Unsub
201 - 300 of 506 matches
Mail list logo