New submission from Rémi Lapeyre :
This is the current repr of the configparser.ConfigParser instances:
>>> import configparser
>>> config = configparser.ConfigParser()
>>> config['sec'] = {}
>>> config
I think this could be improved to read:
-
Change by Rémi Lapeyre :
--
title: Import configparser.ConfigParser repr -> Improve
configparser.ConfigParser repr
___
Python tracker
<https://bugs.python.org/issu
Rémi Lapeyre added the comment:
> Why only sections? ConfigParser contains a lot of other information.
Indeed, the defaults might be useful too. Other things like options
can be sessions specific and could clutter the repr if added.
Would defaults() and sections() be the right behav
Rémi Lapeyre added the comment:
Hi everybody, I opened PR 11781 to add a key argument to functions in the bisect
module. I agree with @dmtr's points that this addition is not a bad design.
As far as I can tell, the key function is at called at most once per item as
this
example where
Change by Rémi Lapeyre :
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue35912>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Rémi Lapeyre :
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue5996>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Rémi Lapeyre :
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue35989>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Rémi Lapeyre :
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue15753>
___
___
Python-bugs-list mailing list
Unsubscribe:
Rémi Lapeyre added the comment:
You will find the line you want to change in
`Doc/reference/lexical_analysis.rst`
--
___
Python tracker
<https://bugs.python.org/issue35
Rémi Lapeyre added the comment:
Hi Magnien, if you have already used Git, everything should be familiar.
You have to clone the whole project, but the documentation leaves in the `Doc`
folder. There is a lot of information that you can get at
https://devguide.python.org/documenting/
If you
Rémi Lapeyre added the comment:
@xtreak, couldn't we have made `_Call` inherit from namedtuple to achieve a
similar result (albeit the handling of name would be weird)?
--
___
Python tracker
<https://bugs.python.org/issue21
Change by Rémi Lapeyre :
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue35954>
___
___
Python-bugs-list mailing list
Unsubscribe:
Rémi Lapeyre added the comment:
I like this patch, working with calls often feels weird and this change
simplify attribute access.
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue21
Rémi Lapeyre added the comment:
Could it be
https://github.com/python/cpython/blob/master/Modules/mathmodule.c#L2565
When 0 is in the iterator, i_result get sets to 0 and then on the next
iteration x/i_result is 0/0 which is undefined behavior?
C99 6.5.5p5 - The result of the / operator
Rémi Lapeyre added the comment:
Hi @Phil Dream, you reuse i in your inner loop, in the for statement.
By the way, I suggest you look at range() to replace your while loop:
https://docs.python.org/3/library/functions.html#func-range.
For your others questions, the mailing list are more
Rémi Lapeyre added the comment:
In some places, using a lot is also a deliberate choice to improve readability.
I think the boy scout rule is more appropriate for such changes.
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.
Change by Rémi Lapeyre :
--
pull_requests: +11764, 11765
___
Python tracker
<https://bugs.python.org/issue4356>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Rémi Lapeyre :
--
pull_requests: +11764
___
Python tracker
<https://bugs.python.org/issue4356>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Rémi Lapeyre :
--
pull_requests: +11764, 11765, 11766
___
Python tracker
<https://bugs.python.org/issue4356>
___
___
Python-bugs-list mailing list
Unsub
Rémi Lapeyre added the comment:
has_key method has been removed in Python3 so I think we can remove it from the
DictProxy as well as nobody should be relying on it anymore.
--
___
Python tracker
<https://bugs.python.org/issue35
Change by Rémi Lapeyre :
--
keywords: +patch
pull_requests: +11841
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Rémi Lapeyre :
--
keywords: +patch, patch, patch
pull_requests: +11841, 11842, 11843
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Rémi Lapeyre :
--
keywords: +patch, patch
pull_requests: +11841, 11842
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Rémi Lapeyre added the comment:
Hi @giampaolo.rodola, I will post a PR for this issue.
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue35
Rémi Lapeyre added the comment:
Is this an issue though? Shouldn't methods be defined in the class definition,
we don't expect setting a function as an attribute to a class to transform it
automatically to a method.
Why would we special case __class_getitem__ and not __init_subclass__
Rémi Lapeyre added the comment:
I think the issue steems from the more general #27015 for which a PR is ready
that fixes the repr not only for ImportError but all other BaseException
subclasses that override __init__.
--
keywords: +patch
nosy: +remi.lapeyre
pull_requests: +11554
Rémi Lapeyre added the comment:
Hi josephsmeng, dict order preservation is now used in a lot of place in
Python. I will post a patch to make pprint use insertion order in a few hours.
--
nosy: +remi.lapeyre
___
Python tracker
<ht
Rémi Lapeyre added the comment:
I opened a PR with @josh.r proposed change.
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue34
Change by Rémi Lapeyre :
--
keywords: +patch, patch, patch
pull_requests: +11611, 11612, 11613
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Change by Rémi Lapeyre :
--
keywords: +patch
pull_requests: +11611
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34886>
___
___
Py
Change by Rémi Lapeyre :
--
keywords: +patch, patch
pull_requests: +11611, 11612
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issu
Rémi Lapeyre added the comment:
Hi, this is the only reason I still use pytest, I would love to be able to use
only unittest and the constant copy-paste is not a great solution and is not
very user friendly.
I would like to wotk on this issue.
StackOverflow has many example on how
Rémi Lapeyre added the comment:
Hi @Maxpxt, I think your first solution is appropriate, do you want to open a
new pull request with your solution and an appropriate test case?
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.
Rémi Lapeyre added the comment:
@gregory.p.smith Do you think the debugHook should be added to the test case or
the test runner?
If we add it to the test case, how do you think the runner should tell the test
case what flags have been given on the command line?
I feel like adding a new
Change by Rémi Lapeyre :
--
versions: +Python 3.8 -Python 3.7
___
Python tracker
<https://bugs.python.org/issue35848>
___
___
Python-bugs-list mailing list
Unsub
Rémi Lapeyre added the comment:
I checked and io.TextIOBase is the only io.IOBase subclass to lack one of read,
readinto or write:
>>> import io, inspect
>>> for name, obj in inspect.getmembers(io, predicate=inspect.isclass):
... missing = {'read', 'readinto', 'write'
Rémi Lapeyre added the comment:
I believe this is why Travis does a `make regen-all` to be sure everything is
up to date.
A patch to keep instructions up-to-date would be nice, newcomers are not
familiar with all `make regen-*` commands.
--
nosy: +remi.lapeyre
Change by Rémi Lapeyre :
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue2>
___
___
Python-bugs-list mailing list
Unsubscribe:
Rémi Lapeyre added the comment:
> A programmer want to instruct the computer to do something, without having to
> care about how it works.
This is not true, as a programmer you need to choose carefully your data
structures because they matter, for example there is a difference between
Change by Rémi Lapeyre :
--
keywords: +patch
pull_requests: +12287
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36272>
___
___
Py
Rémi Lapeyre added the comment:
Here's how you can rewrite your code so it is more explicit:
Python 3.7.2 (default, Feb 12 2019, 08:15:36)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more info
Rémi Lapeyre added the comment:
I think this is the expected behavior, see
https://docs.python.org/3.4/library/email.message.html#email.message.Message.__getitem__
for details:
> Note that if the named field appears more than once in the message’s headers,
> exactly which of those
Change by Rémi Lapeyre :
--
pull_requests: +12290
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue15749>
___
___
Python-bugs-list mai
Rémi Lapeyre added the comment:
Hi Cheryl, I updated and converted the path. Could you please review the PR?
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue15
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_lnotab' mu
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:
I think it could be done with `key=lambda item: -item` if the key argument is
added.
--
___
Python tracker
<https://bugs.python.org/issue4
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 blake2b_init
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
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 cmp(a, b):
... if a > b: return -1
... if a
Change by Rémi Lapeyre :
--
versions: +Python 3.9
___
Python tracker
<https://bugs.python.org/issue4356>
___
___
Python-bugs-list mailing list
Unsubscribe:
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:
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: +remi.lapeyre
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 though
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 @blueyed, can you confirm PR 13497 solve your issue ?
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue37
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 @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:
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
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.lapeyre
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
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
<ht
Rémi Lapeyre added the comment:
A test for this has been added for IntFlag so I think it must have been on
purpose :
https://github.com/python/cpython/commit/9430652535f88125d8003f342a8884d34885d876#diff-d57e55a3bb4873aec10786e531a88947R2386
--
nosy: +remi.lapeyre
Rémi Lapeyre added the comment:
If issue4356 is accepted, I think it may be possible to use `key=lambda e: -e`.
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue36
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
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/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/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
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
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 having
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:
> Serhiy's message crossed with mine.
And mine crossed with yours, sorry. I will update my PR shortly.
--
___
Python tracker
<https://bugs.python.org/issu
Rémi Lapeyre added the comment:
Hi, I have been looking to get more acquainted with the peephole optimizer. Is
it okay if I work on this?
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue36
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
New submission from Rémi Lapeyre :
Hi, to make unittest more extensible and for issue 18765 (having a way to run
pdb when tests fail), I would like to make TestCase aware of the command line
arguments given to the TestProgram so they can adapt their behavior based on
them.
I suggested
Rémi Lapeyre added the comment:
Hi josh.r, this may be dump but is there a reason not to make slices hashable?
Couldn't they hash like a tuple (start, stop, step)?
I looked around in the code, bpo and the mailing lists but could not find a
reason why not, maybe it was just not useful
Change by Rémi Lapeyre :
--
keywords: +patch
pull_requests: +13066
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36825>
___
___
Py
Rémi Lapeyre added the comment:
For information, issue 33927 is related. I removed one of the FileType from
json.tool argument parser to work around this behavior
(https://github.com/python/cpython/pull/7865/files#diff-e94945dd18482591faf1e294b029a6afR44).
If paul.j3 does not have his patch
Rémi Lapeyre added the comment:
Hi Windson, I had a working patch but got stuck on making this behavior
optional (the `if SOMETHING_SAYS_TO_ENABLE_THIS:` in @gregory.p.smith initial
post).
To make TestCase aware of the command line arguments given to the test runner I
opened issue 36825 so
Rémi Lapeyre added the comment:
Hi @bup, thanks for opening a new bug report. I'm not sure I get what is the
issue though. Could you attach a more readable example and explain exactly when
you expect __index__ to be called?
--
nosy: +remi.lapeyre
Change by Rémi Lapeyre :
--
keywords: +patch
pull_requests: +13020
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Rémi Lapeyre added the comment:
The issue is also present in Astor:
Python 3.7.3 (default, Mar 27 2019, 09:23:15)
[Clang 10.0.1 (clang-1001.0.46.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>&
Rémi Lapeyre added the comment:
Hi Cheryl,
thanks for the ping.
I wasn't sure my patch was correct but reading typeobject.c:add_operators(), it
is actually more straight-forward than I thought.
Serhiy Storchaka: This is indeed a duplicate of issue20092. I believe the
solution proposed
Change by Rémi Lapeyre :
--
pull_requests: +13023
___
Python tracker
<https://bugs.python.org/issue20092>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Rémi Lapeyre :
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue36717>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Rémi Lapeyre :
--
nosy: +remi.lapeyre
___
Python tracker
<https://bugs.python.org/issue33997>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Rémi Lapeyre :
As far as I can tell, it has never been documented. I'm not sure if it is
deprecated but it has a docstring so it seems to me, that it just needs
documentation in Doc/Library/threading.rst
PS: I don't know how to set the beginner friendly flag
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 just
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.
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
Rémi Lapeyre added the comment:
The documentation is correct, in Python argument are computed before the
call to a function, not when they are used. You can try other functions
than dict.setdefault() and see that the behaviour is always the same.
Le dim. 8 déc. 2019 à 22:47, da-dada a écrit
Rémi Lapeyre added the comment:
>
>
> def __init__(self):
> vars(self).setdefault('default', self.set_default())
> vars(self).setdefault('default', self.set_default())
>
This code is equivalent to
def __init__(self):
x = self.set_default()
201 - 300 of 506 matches
Mail list logo