[issue36023] Import configparser.ConfigParser repr

2019-02-18 Thread Rémi Lapeyre
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: -

[issue36023] Improve configparser.ConfigParser repr

2019-02-18 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- title: Import configparser.ConfigParser repr -> Improve configparser.ConfigParser repr ___ Python tracker <https://bugs.python.org/issu

[issue36023] Improve configparser.ConfigParser repr

2019-02-18 Thread Rémi Lapeyre
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

[issue4356] Add "key" argument to "bisect" module functions

2019-02-18 Thread Rémi Lapeyre
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

[issue35912] _testembed.c fails to compile when using --with-cxx-main in the configure step

2019-02-09 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- nosy: +remi.lapeyre ___ Python tracker <https://bugs.python.org/issue35912> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5996] abstract class instantiable when subclassing built-in types

2019-02-12 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- nosy: +remi.lapeyre ___ Python tracker <https://bugs.python.org/issue5996> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35989] ipaddress.IPv4Network allows prefix > 32

2019-02-13 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- nosy: +remi.lapeyre ___ Python tracker <https://bugs.python.org/issue35989> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15753] No-argument super in method with variable arguments raises SystemError

2019-02-13 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- nosy: +remi.lapeyre ___ Python tracker <https://bugs.python.org/issue15753> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35962] Slight error in words in [ 2.4.1. String and Bytes literals ]

2019-02-14 Thread Rémi Lapeyre
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

[issue35962] Slight error in words in [ 2.4.1. String and Bytes literals ]

2019-02-14 Thread Rémi Lapeyre
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

[issue21269] Provide args and kwargs attributes on mock call objects

2019-02-10 Thread Rémi Lapeyre
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

[issue35954] Incoherent type conversion in configparser

2019-02-10 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- nosy: +remi.lapeyre ___ Python tracker <https://bugs.python.org/issue35954> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21269] Provide args and kwargs attributes on mock call objects

2019-02-10 Thread Rémi Lapeyre
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

[issue35959] math.prod(range(10)) caues segfault

2019-02-10 Thread Rémi Lapeyre
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

[issue35910] Curious problem with my choice of variables

2019-02-06 Thread Rémi Lapeyre
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

[issue36039] Replace append loops with list comprehensions

2019-02-19 Thread Rémi Lapeyre
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.

[issue4356] Add "key" argument to "bisect" module functions

2019-02-07 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- pull_requests: +11764, 11765 ___ Python tracker <https://bugs.python.org/issue4356> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4356] Add "key" argument to "bisect" module functions

2019-02-07 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- pull_requests: +11764 ___ Python tracker <https://bugs.python.org/issue4356> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4356] Add "key" argument to "bisect" module functions

2019-02-07 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- pull_requests: +11764, 11765, 11766 ___ Python tracker <https://bugs.python.org/issue4356> ___ ___ Python-bugs-list mailing list Unsub

[issue35918] multiprocessing's SyncManager.dict.has_key() method is broken

2019-02-11 Thread Rémi Lapeyre
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

[issue35918] multiprocessing's SyncManager.dict.has_key() method is broken

2019-02-11 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch pull_requests: +11841 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35918] multiprocessing's SyncManager.dict.has_key() method is broken

2019-02-11 Thread Rémi Lapeyre
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

[issue35918] multiprocessing's SyncManager.dict.has_key() method is broken

2019-02-11 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch, patch pull_requests: +11841, 11842 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35918] multiprocessing's SyncManager.dict.has_key() method is broken

2019-02-11 Thread Rémi Lapeyre
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

[issue36042] Setting __init_subclass__ and __class_getitem__ methods are in runtime doesnt make them class method.

2019-02-19 Thread Rémi Lapeyre
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__

[issue29999] repr() of ImportError misses keyword arguments name and path

2019-01-30 Thread Rémi Lapeyre
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

[issue30670] pprint for dict in sorted order or insert order?

2019-02-01 Thread Rémi Lapeyre
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

[issue34886] subprocess.run throws exception when input and stdin are passed as kwargs

2019-02-01 Thread Rémi Lapeyre
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

[issue34886] subprocess.run throws exception when input and stdin are passed as kwargs

2019-02-01 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch, patch, patch pull_requests: +11611, 11612, 11613 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue34886] subprocess.run throws exception when input and stdin are passed as kwargs

2019-02-01 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch pull_requests: +11611 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34886> ___ ___ Py

[issue34886] subprocess.run throws exception when input and stdin are passed as kwargs

2019-02-01 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch, patch pull_requests: +11611, 11612 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue18765] unittest needs a way to launch pdb.post_mortem or other debug hooks

2019-02-04 Thread Rémi Lapeyre
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

[issue35899] '_is_sunder' function in 'enum' module fails on empty string

2019-02-05 Thread Rémi Lapeyre
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.

[issue18765] unittest needs a way to launch pdb.post_mortem or other debug hooks

2019-02-05 Thread Rémi Lapeyre
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

[issue35848] readinto is not a method on io.TextIOBase

2019-01-29 Thread Rémi Lapeyre
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

[issue35848] readinto is not a method on io.TextIOBase

2019-01-29 Thread Rémi Lapeyre
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'

[issue35887] Doc string for updating the frozen version of importlib in _bootstrap.py incorrect

2019-02-04 Thread Rémi Lapeyre
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

[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2019-02-05 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- nosy: +remi.lapeyre ___ Python tracker <https://bugs.python.org/issue2> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35897] Support list as argument to .startswith()

2019-02-05 Thread Rémi Lapeyre
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

[issue36272] Recursive logging crashes Interpreter in Python 3

2019-03-13 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch pull_requests: +12287 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36272> ___ ___ Py

[issue36303] Trying to change values (fe. "To", "From") of email.mime.text.MIMEText after initial assigment silently doesn't change them.

2019-03-15 Thread Rémi Lapeyre
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

[issue36303] Trying to change values (fe. "To", "From") of email.mime.text.MIMEText after initial assigment silently doesn't change them.

2019-03-15 Thread Rémi Lapeyre
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

[issue15749] cgitb prints html for text when display disabled.

2019-03-13 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- pull_requests: +12290 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue15749> ___ ___ Python-bugs-list mai

[issue15749] cgitb prints html for text when display disabled.

2019-03-13 Thread Rémi Lapeyre
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

[issue37034] Argument Clinic omits name of keyword-only parameter on _PyArg_BadArgument() call

2019-05-27 Thread Rémi Lapeyre
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

[issue37034] Argument Clinic omits name of keyword-only parameter on _PyArg_BadArgument() call

2019-05-27 Thread Rémi Lapeyre
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

[issue4356] Add "key" argument to "bisect" module functions

2019-05-26 Thread Rémi Lapeyre
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

[issue37055] Numerous warnings with blake2 module

2019-05-26 Thread Rémi Lapeyre
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

[issue37011] pdb: restore original tracing function instead of sys.settrace(None)

2019-05-26 Thread Rémi Lapeyre
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

[issue4356] Add "key" argument to "bisect" module functions

2019-05-26 Thread Rémi Lapeyre
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

[issue4356] Add "key" argument to "bisect" module functions

2019-05-26 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue4356> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37030] Lib/cmd.py: Hide undocumented commands in help and completenames

2019-06-03 Thread Rémi Lapeyre
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

[issue37102] Automatically dedent docstring constants by default

2019-05-31 Thread Rémi Lapeyre
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

[issue37102] Automatically dedent docstring constants by default

2019-06-06 Thread Rémi 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

[issue35954] Incoherent type conversion in configparser

2019-06-09 Thread Rémi Lapeyre
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

[issue32884] Adding the ability for getpass to print asterisks when passowrd is typed

2019-06-09 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- nosy: +remi.lapeyre ___ Python tracker <https://bugs.python.org/issue32884> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37011] pdb: restore original tracing function instead of sys.settrace(None)

2019-05-22 Thread Rémi Lapeyre
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

[issue37011] pdb: restore original tracing function instead of sys.settrace(None)

2019-05-22 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch pull_requests: +13413 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue37011> ___ ___ Py

[issue37033] Dictionary defaults .get(), .pop(), .setdefault()

2019-05-24 Thread Rémi Lapeyre
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

[issue37022] pdb: do_p and do_pp swallow exceptions from __repr__

2019-05-24 Thread Rémi Lapeyre
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

[issue35775] Add a general selection function to statistics

2019-05-24 Thread Rémi Lapeyre
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

[issue37022] pdb: do_p and do_pp swallow exceptions from __repr__

2019-05-24 Thread Rémi Lapeyre
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

[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2019-05-20 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch pull_requests: +13353 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36906> ___ ___ Py

[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2019-05-20 Thread Rémi Lapeyre
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

[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2019-05-20 Thread Rémi Lapeyre
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

[issue33217] x in enum.Flag member is True when x is not a Flag

2019-05-08 Thread Rémi Lapeyre
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

[issue36857] bisect should support descending order

2019-05-08 Thread Rémi 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

[issue36969] pdb: do_args: display/handle keyword-only arguments

2019-05-21 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- pull_requests: +13369 ___ Python tracker <https://bugs.python.org/issue36969> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36969] pdb.do_args: display keyword-only and positional only arguments

2019-05-21 Thread Rémi Lapeyre
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

[issue36975] csv: undocumented UnicodeDecodeError on malformed file

2019-05-21 Thread Rémi Lapeyre
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

[issue36975] csv: undocumented UnicodeDecodeError on malformed file

2019-05-21 Thread Rémi Lapeyre
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

[issue36975] csv: undocumented UnicodeDecodeError on malformed file

2019-05-21 Thread Rémi Lapeyre
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

[issue36975] csv: undocumented UnicodeDecodeError on malformed file

2019-05-21 Thread Rémi Lapeyre
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

[issue36230] Please sort assertSetEqual's output

2019-05-21 Thread Rémi Lapeyre
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

[issue36975] csv: undocumented UnicodeDecodeError on malformed file

2019-05-21 Thread Rémi Lapeyre
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

[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2019-05-20 Thread Rémi Lapeyre
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

[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2019-05-20 Thread Rémi Lapeyre
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

[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2019-05-14 Thread Rémi Lapeyre
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

[issue36969] pdb: do_args: display/handle keyword-only arguments

2019-05-20 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch pull_requests: +13361 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36969> ___ ___ Py

[issue36969] pdb: do_args: display/handle keyword-only arguments

2019-05-20 Thread Rémi Lapeyre
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

[issue36825] Make TestCase aware of the command line arguments given to TestProgram

2019-05-07 Thread Rémi Lapeyre
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

[issue11107] Cache constant "slice" instances

2019-05-07 Thread Rémi Lapeyre
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

[issue36825] Make TestCase aware of the command line arguments given to TestProgram

2019-05-07 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch pull_requests: +13066 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36825> ___ ___ Py

[issue13824] argparse.FileType opens a file and never closes it

2019-05-07 Thread Rémi Lapeyre
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

[issue18765] unittest needs a way to launch pdb.post_mortem or other debug hooks

2019-05-08 Thread Rémi Lapeyre
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

[issue36846] range_iterator does not use __index__

2019-05-08 Thread Rémi Lapeyre
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

[issue33039] int() and math.trunc don't accept objects that only define __index__

2019-05-06 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch pull_requests: +13020 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue28002] Some f-strings do not round trip through Tools/parser/test_unparse.py

2019-05-06 Thread Rémi Lapeyre
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. >&

[issue33039] int() and math.trunc don't accept objects that only define __index__

2019-05-06 Thread Rémi Lapeyre
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

[issue20092] type() constructor should bind __int__ to __index__ when __index__ is defined and __int__ is not

2019-05-06 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- pull_requests: +13023 ___ Python tracker <https://bugs.python.org/issue20092> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36717] Allow retrieval of return value from the target of a threading.Thread

2019-05-06 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- nosy: +remi.lapeyre ___ Python tracker <https://bugs.python.org/issue36717> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33997] multiprocessing Pool hangs in terminate()

2019-08-04 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- nosy: +remi.lapeyre ___ Python tracker <https://bugs.python.org/issue33997> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37883] threading.Lock.locked is not documented

2019-08-18 Thread Rémi Lapeyre
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

[issue37728] 'is' behaving differently in script and interactive shel

2019-07-31 Thread Rémi Lapeyre
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

[issue33997] multiprocessing Pool hangs in terminate()

2019-08-05 Thread Rémi Lapeyre
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

[issue33997] multiprocessing Pool hangs in terminate()

2019-08-05 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- components: +Library (Lib) -Windows ___ Python tracker <https://bugs.python.org/issue33997> ___ ___ Python-bugs-list mailing list Unsub

[issue33997] multiprocessing Pool hangs in terminate()

2019-08-05 Thread Rémi Lapeyre
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.

[issue37739] list(filter) returns [] ???

2019-08-01 Thread Rémi Lapeyre
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

[issue38998] dict.setdefault (setdefault of dictionary)

2019-12-08 Thread Rémi Lapeyre
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

[issue38998] dict.setdefault (setdefault of dictionary)

2019-12-08 Thread Rémi Lapeyre
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()

<    1   2   3   4   5   6   >