[issue33462] reversible dict

2018-05-12 Thread Rémi Lapeyre
Rémi Lapeyre <remi.lape...@henki.fr> added the comment: Hi, I'm taking a look this issue, it look like a new type `PyDictRevIterKey_Type` needs to be defined with its associated methods. I will try to implement the modifications ; this is the first time i'm taking a dive in Python's int

[issue33462] reversible dict

2018-05-17 Thread Rémi Lapeyre
Rémi Lapeyre <remi.lape...@henki.fr> added the comment: Hi Serhiy Storchaka, I will update the PR to implement this functionality in the views too -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue33462] reversible dict

2018-05-24 Thread Rémi Lapeyre
Rémi Lapeyre <remi.lape...@henki.fr> added the comment: This change does add built-in types but I think it's a reasonable expectation as a python user to be able to do reversed(dict(a=1, b=20) since the order is know defined in the specifications. It seems inconsistent to have an

[issue33462] reversible dict

2018-05-24 Thread Rémi Lapeyre
Rémi Lapeyre <remi.lape...@henki.fr> added the comment: >> I think it's a reasonable expectation as a python user to be able to do >> reversed(dict(a=1, b=20) since the order is know defined in the >> specifications. > I agree about "reasonable e

[issue33462] reversible dict

2018-05-24 Thread Rémi Lapeyre
Rémi Lapeyre <remi.lape...@henki.fr> added the comment: Since there seems to be a consensus about this change being too much, should we go back to the first proposal to implement dict.__reversed__ only and not reversed for the views, this would greatly reduce the bload or dump

[issue33462] reversible dict

2018-05-23 Thread Rémi Lapeyre
Rémi Lapeyre <remi.lape...@henki.fr> added the comment: I updated the pull request, now reversed work on the dict and dict views: ➜ cpython git:(master) ./python.exe Python 3.8.0a0 (heads/master-dirty:128576b88c, May 23 2018, 16:33:46) [Clang 9.0.0 (clang-900.0.39.2)] on darwin Type

[issue33462] reversible dict

2018-06-10 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi INADA thanks for the benchmark, I did both of them too and got the same results (though I had to apply https://github.com/python/performance/pull/41 to get the performance module working). Should I apply your patch in PR 6827

[issue33462] reversible dict

2018-06-14 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi, I took a look at the code of OrderedDict it's using the double linked-list to iterate through the items using _odictnode_PREV and _odictnode_NEXT. Since ordereddict needs to support move_to_end that will change the iterating order while dict does

[issue33462] reversible dict

2018-06-13 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Thanks INADA, I made the necessary changes to _collections_abc. Is there anything that I should change? -- ___ Python tracker <https://bugs.python.org/issue33

[issue28657] cmd.Cmd.get_help() implementation can't see do_*() methods added dynamically by setattr()

2018-06-29 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch pull_requests: +7623 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue28657> ___ ___ Py

[issue28657] cmd.Cmd.get_help() implementation can't see do_*() methods added dynamically by setattr()

2018-06-29 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi Błażej Michalik, can you confirm the attached patch fixed the issue for you? -- nosy: +remi.lapeyre ___ Python tracker <https://bugs.python.org/issue28

[issue33927] Allow json.tool to have identical infile and outfile

2018-06-29 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi Pablo, I added two tests to confirm that file descriptors do not link anymore. The tests are rather ugly but I'm not sure if it's possible to do better. Is this patch ok for you? -- ___ Python tracker <ht

[issue34005] Replace inspect.formatargspec by inspect.signature in xmlrpc module

2018-06-29 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch pull_requests: +7624 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34005> ___ ___ Py

[issue34005] Replace inspect.formatargspec by inspect.signature in xmlrpc module

2018-06-29 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- components: +Library (Lib), XML versions: +Python 3.8 ___ Python tracker <https://bugs.python.org/issue34005> ___ ___ Python-bug

[issue34005] Replace inspect.formatargspec by inspect.signature in xmlrpc module

2018-06-29 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Indeed, it is the exact same patch. Sorry about the duplicate. -- resolution: -> duplicate stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34005] Replace inspect.formatargspec by inspect.signature in xmlrpc module

2018-06-29 Thread Rémi Lapeyre
New submission from Rémi Lapeyre : xmlrpc still makes use of formatargspec which is deprecated since Python 3.5 and raises a deprecation warning: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly The proposed patch replace

[issue33927] Allow json.tool to have identical infile and outfile

2018-06-22 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch pull_requests: +7474 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33927> ___ ___ Py

[issue33927] Allow json.tool to have identical infile and outfile

2018-06-23 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi, I proposed a path in https://github.com/python/cpython/pull/7865, I'm not sure if I can apply the label `skip news` or if only a reviewer can. -- ___ Python tracker <https://bugs.python.org/issue33

[issue33947] Dataclasses can raise RecursionError in __repr__

2018-06-23 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: This seems like a difficult problem to tackle in all cases, if two dataclasses reference each other the cycle could be complex to identify and introduce complexity. The way repr is defined is part of PEP 557 and actually force this behavior. Should the `repr

[issue33927] Allow json.tool to have identical infile and outfile

2018-06-21 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi Michael, looking at the current code of json.tool, there is no reason for it not to be able to do this, I will a patch to do this tonight. -- nosy: +remi.lapeyre ___ Python tracker <https://bugs.python.

[issue33462] reversible dict

2018-06-21 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi, is everything good with attached PR or should I refactor it further? -- ___ Python tracker <https://bugs.python.org/issue33

[issue33462] reversible dict

2018-07-21 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi Serhiy and Inada, is there a reason not to move forward with this patch? -- ___ Python tracker <https://bugs.python.org/issue33

[issue34035] zipfile: AttributeError in "seek" method of "_SharedFile" class

2018-07-04 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi Evegeny, I was able to reproduce the issue, if it's all right for you I would like to post a PR to solve the issue and extend the test suite od this module. -- nosy: +remi.lapeyre ___ Python tracker <ht

[issue28657] cmd.Cmd.get_help() implementation can't see do_*() methods added dynamically by setattr()

2018-07-10 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi Raymond, would updating the attached PR to change https://github.com/remilapeyre/cpython/blob/7c78350f8903f162e5f70ee147c0e97cb1ed5181/Lib/cmd.py#L270 (and others) from `compfunc = getattr(self, 'complete_' + cmd)` to `compfunc = getattr(self.__class__

[issue33927] Allow json.tool to have identical infile and outfile

2018-06-24 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi Pablo, while this patch should fix both problems, I'm not sure how to write a regression test for this, `assert_python_ok` in https://github.com/python/cpython/pull/7865/files#diff-7d4645839a05727ebdf39226fd56e29cR97 forks the interpreter so I'm not sure I

[issue35120] SSH tunnel support to ftp lib

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

[issue23930] http.cookies.SimpleCookie doesn't parse comma-only separated cookies correctly

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

[issue34950] Parse trusted and signature information from X509 certificate

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

[issue34510] add HTTPConnection.settimeout()

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

[issue10486] http.server doesn't set all CGI environment variables

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

[issue23930] http.cookies.SimpleCookie doesn't parse comma-only separated cookies correctly

2018-11-10 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: This is not a valid cookie string and I think neither Django nor Nginx would understand this cookie correctly. On the other hand, per RFC 6265 the comma is a forbidden character in a cookie value (https://tools.ietf.org/html/rfc6265#section-4.1.1

[issue35222] email.utils.formataddr is not exactly the reverse of email.utils.parseaddr

2018-11-12 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: This is indeed an issue with formataddr, it expects the input to be ascii encoded as RFC 2822 requires. Email is much more complicated though and has been internationalized, a summary of this work is available at https://en.wikipedia.org/wiki/Email_address

[issue10486] http.server doesn't set all CGI environment variables

2018-11-13 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi Glenn, I'm not aware of a document that defines CGI better than the RFC and I don't know it enough to disgress from the published standard (even if it is not what isdone today as I don't know the current practices enough). Here is the variables defined

[issue10486] http.server doesn't set all CGI environment variables

2018-11-12 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: The reference given in https://github.com/python/cpython/blob/b36b0a3765bcacb4dcdbf12060e9e99711855da8/Lib/http/server.py#L1074 is not accessible anymore. I think we should replace it by https://tools.ietf.org/html/rfc3875#section-4.1

[issue23930] http.cookies.SimpleCookie doesn't parse comma-only separated cookies correctly

2018-11-12 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch pull_requests: +9752 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue23930> ___ ___ Py

[issue10486] http.server doesn't set all CGI environment variables

2018-11-12 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: AUTH_TYPE, CONTENT_LENGTH, CONTENT_TYPE, REMOTE_USER are present REMOTE_IDENT is not but I'm not sure it's worth adding. I can send a PR to add REMOTE_HOST and remove the condition for QUERY_STRING. Otherwise, I don't think the other environment variables

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

2018-12-31 Thread Rémi Lapeyre
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/issu

[issue35627] multiprocessing.queue in 3.7.2 doesn't behave as it was in 3.7.1

2018-12-31 Thread Rémi Lapeyre
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? --

[issue35624] Shelve sync issues while using Gevent

2018-12-31 Thread Rémi Lapeyre
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

[issue35629] hang and/or leaked processes with multiprocessing.Pool(...).imap(...)

2018-12-31 Thread Rémi Lapeyre
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 '?' for help. In [1]: import

[issue35527] Make fields selectively immutable in dataclasses

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

[issue35577] side_effect mocked method lose reference to instance

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

[issue35540] dataclasses.asdict breaks with defaultdict fields

2018-12-29 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch, patch pull_requests: +10682, 10683 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35540] dataclasses.asdict breaks with defaultdict fields

2018-12-29 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch pull_requests: +10682 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35540> ___ ___ Py

[issue35540] dataclasses.asdict breaks with defaultdict fields

2018-12-29 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch, patch, patch pull_requests: +10682, 10683, 10684 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35540] dataclasses.asdict breaks with defaultdict fields

2018-12-29 Thread Rémi Lapeyre
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

[issue35629] hang and/or leaked processes with multiprocessing.Pool(...).imap(...)

2019-01-02 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- nosy: +pablogsal ___ Python tracker <https://bugs.python.org/issue35629> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35629] hang and/or leaked processes with multiprocessing.Pool(...).imap(...)

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

[issue8538] Add FlagAction to argparse

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

[issue27015] subprocess.CalledProcessError's repr changes based on kwargs, and doesn't unpickle

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

[issue27015] subprocess.CalledProcessError's repr changes based on kwargs, and doesn't unpickle

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

[issue27015] subprocess.CalledProcessError's repr changes based on kwargs, and doesn't unpickle

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

[issue27015] subprocess.CalledProcessError's repr changes based on kwargs, and doesn't unpickle

2019-01-16 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: I tried to fix the issue, the attached PR solves the issue of saving the kwargs and unpickling the exception but I was not able to fix a regression I caused in test_memory_error_in_PyErr_PrintEx. -- versions: +Python 3.6, Python 3.7, Python 3.8

[issue17005] Add a topological sort algorithm

2019-01-17 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: As the name been already discussed ? I fear that topsort might only be clear to people already knowing what it does. topoligical_sort would be more discoverable and explicit and one can always do from functools import topological_sort as tsort if he

[issue20479] Efficiently support weight/frequency mappings in the statistics module

2019-01-18 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Is this proposal still relevant? If so, I would like to work on its implementation. I think the third proposition to change the API to have a new `weights` parameter is the best has it does not blindly suppose that a tuple is a pair (value, weight) which

[issue20479] Efficiently support weight/frequency mappings in the statistics module

2019-01-18 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- versions: +Python 3.8 -Python 3.7 ___ Python tracker <https://bugs.python.org/issue20479> ___ ___ Python-bugs-list mailing list Unsub

[issue20399] Comparison of memoryview

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

[issue30999] statistics module: add "key" keyword argument to median, mode, ...

2019-01-18 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: I suggest we closed this issue in favor of #35775 to discuss adding a selection function and the attached PR. -- nosy: +remi.lapeyre ___ Python tracker <https://bugs.python.org/issue30

[issue35775] Add a general selection function to statistics

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

[issue35775] Add a general selection function to statistics

2019-01-18 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- nosy: +rhettinger, steven.daprano ___ Python tracker <https://bugs.python.org/issue35775> ___ ___ Python-bugs-list mailing list Unsub

[issue35775] Add a general selection function to statistics

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

[issue35775] Add a general selection function to statistics

2019-01-18 Thread Rémi Lapeyre
New submission from Rémi Lapeyre : Like discussed in #30999, the attached PR adds a general selection function to the statistics module. This allows to simply get the element at a given quantile of a collection. https://www.cs.rochester.edu/~gildea/csc282/slides/C09-median.pdf

[issue35775] Add a general selection function to statistics

2019-01-18 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Wouldn't be the 5-th percentile be select(data, round(len(data)/20)? -- ___ Python tracker <https://bugs.python.org/issue35

[issue17005] Add a topological sort algorithm

2019-01-20 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: > 2) Topological sorting usually is well-defined on totally connected graphs, > so I do not know what exactly it means to topologically sort two disjoint > graphs. This was one of the main drawbacks of the tuple-based approach, but I > think it m

[issue35734] ipaddress's _BaseV4._is_valid_netmask fails to detect invalid netmask like 255.254.128.0

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

[issue35734] ipaddress's _BaseV4._is_valid_netmask fails to detect invalid netmask like 255.254.128.0

2019-01-17 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: I opened https://github.com/python/cpython/pull/11591 to remove _valid_mask_octets, _is_valid_netmask and _is_hostmask from ipaddress, the patch proposed in issue27860 has a larger scope so it's probably better to remove those unused methods in this issue

[issue35734] ipaddress's _BaseV4._is_valid_netmask fails to detect invalid netmask like 255.254.128.0

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

[issue35734] ipaddress's _BaseV4._is_valid_netmask fails to detect invalid netmask like 255.254.128.0

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

[issue35761] Allow dataclasses to be updated in place

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

[issue35734] Remove unused _BaseV4._is_valid_netmask in ipaddress

2019-01-17 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: I changed the subject of this issue as the scope of issue27860 is larger. I will review them and open a new PR for them if appropriate once this one is accepted. -- title: ipaddress's _BaseV4._is_valid_netmask fails to detect invalid netmask like

[issue35227] [RFE] tarfile: support adding file objects without prior known size

2018-12-02 Thread Rémi Lapeyre
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 `gettarinfo

[issue35338] set union/intersection/difference could accept zero arguments

2018-11-29 Thread Rémi Lapeyre
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? -- nosy

[issue35227] [RFE] tarfile: support adding file objects without prior known size

2018-11-21 Thread Rémi Lapeyre
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

[issue35227] [RFE] tarfile: support adding file objects without prior known size

2018-11-21 Thread Rémi Lapeyre
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 TarInfo

[issue35227] [RFE] tarfile: support adding file objects without prior known size

2018-11-21 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- nosy: +remi.lapeyre ___ Python tracker <https://bugs.python.org/issue35227> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35227] [RFE] tarfile: support adding file objects without prior known size

2018-11-26 Thread Rémi Lapeyre
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

[issue35227] [RFE] tarfile: support adding file objects without prior known size

2018-11-26 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch pull_requests: +9963 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35227> ___ ___ Py

[issue35327] Using skipTest with subTest gives a misleading UI.

2018-11-27 Thread Rémi Lapeyre
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 'Not supported

[issue35227] [RFE] tarfile: support adding file objects without prior known size

2018-11-27 Thread Rémi Lapeyre
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

[issue35327] Using skipTest with subTest gives a misleading UI.

2018-11-27 Thread Rémi Lapeyre
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

[issue35698] Division by 2 in statistics.median

2019-01-10 Thread Rémi Lapeyre
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. Especially

[issue35707] time.sleep() should support objects with __float__

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

[issue35698] Division by 2 in statistics.median

2019-01-10 Thread Rémi Lapeyre
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 vote to

[issue35707] time.sleep() should support objects with __float__

2019-01-10 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- nosy: +ncoghlan ___ Python tracker <https://bugs.python.org/issue35707> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35707] time.sleep() should support objects with __float__

2019-01-10 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: See #33039 for the proposed change to __int__. -- ___ Python tracker <https://bugs.python.org/issue35707> ___ ___ Python-bug

[issue35710] Make dataclasses.field() accept another name for __init__ field's name

2019-01-10 Thread Rémi Lapeyre
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 making a

[issue31855] mock_open is not compatible with read(n) (and pickle.load)

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

[issue17467] Enhancement: give mock_open readline() and readlines() methods

2019-01-11 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- pull_requests: +11101, 11102, 11103 ___ Python tracker <https://bugs.python.org/issue17467> ___ ___ Python-bugs-list mailing list Unsub

[issue35717] enum.Enum error on sys._getframe(2)

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

[issue31855] mock_open is not compatible with read(n) (and pickle.load)

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

[issue31855] mock_open is not compatible with read(n) (and pickle.load)

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

[issue27015] subprocess.CalledProcessError's repr changes based on kwargs, and doesn't unpickle

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

[issue17467] Enhancement: give mock_open readline() and readlines() methods

2019-01-11 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- pull_requests: +11101 ___ Python tracker <https://bugs.python.org/issue17467> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17467] Enhancement: give mock_open readline() and readlines() methods

2019-01-11 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- pull_requests: +11101, 11102 ___ Python tracker <https://bugs.python.org/issue17467> ___ ___ Python-bugs-list mailing list Unsub

[issue35717] enum.Enum error on sys._getframe(2)

2019-01-11 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi, PR https://github.com/python/cpython/pull/11521 should fix the issue. -- ___ Python tracker <https://bugs.python.org/issue35

[issue31855] mock_open is not compatible with read(n) (and pickle.load)

2019-01-11 Thread Rémi Lapeyre
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 fetching d

[issue35717] enum.Enum error on sys._getframe(2)

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

[issue35232] Add `module`/`qualname` arguments to make_dataclass for picklability

2018-12-30 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- keywords: +patch, patch pull_requests: +10710, 10711 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35232] Add `module`/`qualname` arguments to make_dataclass for picklability

2018-12-30 Thread Rémi Lapeyre
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 determine

[issue35606] Add prod() function to the math module

2018-12-30 Thread Rémi Lapeyre
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

  1   2   3   4   5   6   >