[issue28677] difficult to parse sentence structure in "When an instance attribute is referenced that isn't a data attribute"

2018-03-15 Thread Cheryl Sabella
Change by Cheryl Sabella : -- keywords: +easy stage: -> needs patch versions: +Python 3.7, Python 3.8 ___ Python tracker ___

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I do not see a point in adding a function that will never be used correctly. -- ___ Python tracker

[issue32421] Keeping an exception in cache can segfault the interpreter

2018-03-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: I repeated Julian's test with installed 3.7.0b2 on Windows 10 and there is no crash when running either from a command line or from an IDLE editor. So either the issue has been fixed since 3.6.2, or it is specific to some undisclosed

[issue33073] Add as_integer_ratio() to int() objects

2018-03-15 Thread Tim Peters
Tim Peters added the comment: Serhiy, I don't understand. If `numbers.Rational` is in fact a superclass of `numpy.int64`, then the latter will inherit an implementation added to the former. The idea here isn't to add an abstract method to the Rational interface, but a

[issue33073] Add as_integer_ratio() to int() objects

2018-03-15 Thread Mark Dickinson
Mark Dickinson added the comment: It's a "virtual" subclass. The numpy.integer parent class is registered here: https://github.com/numpy/numpy/blob/10ccfe747a68d974ff16a5c0765054b816d5486f/numpy/core/numerictypes.py#L944 -- ___

[issue32328] ttk.Treeview: _tkinter.TclError: list element in quotes followed by "; " instead of space

2018-03-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: Our ttk doc, https://docs.python.org/3/library/tkinter.ttk.html#item-options, here copies the tk doc: "The list of values associated with the item." It should say 'tuple or list', but that is a generic (and separate) issue of our ttk doc

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-15 Thread Tim Peters
Tim Peters added the comment: [Raymond] > The OPs notion of "absurd" behavior implies a rule that > all float methods should be available for ints. That > would suggest the is_integer, hex, fromhex, and > as_integer_ratio would all need to propagate to the > other types as

[issue33073] Add as_integer_ratio() to int() objects

2018-03-15 Thread Mark Dickinson
Mark Dickinson added the comment: [Tim] > [...] what would _you_ like to see done here? Given that float.as_integer_ratio and Decimal.as_integer_ratio already exist, and that I don't have a working time machine right now, I'm in favour of adding int.as_integer_ratio

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-15 Thread Jonathan Springer
Change by Jonathan Springer : -- nosy: +springermac ___ Python tracker ___ ___

[issue33080] regen-importlib is causing build races against other regen-all targets in Makefile.pre.in

2018-03-15 Thread Alexander Kanavin
New submission from Alexander Kanavin : You can see here: https://github.com/python/cpython/blob/master/Makefile.pre.in#L708 that regen-importlib is building a binary from .o files which are built from .c and .h files, which are, at the same time, regenerated by other

[issue33073] Add as_integer_ratio() to int() objects

2018-03-15 Thread Tim Peters
Tim Peters added the comment: Thanks, Mark! So if int.as_integer_ratio is added to the core, numpy.int64 won't magically have it too, regardless of whether we do or don't add an implementation to numbers.Rational. As an end user, I'd be surprised if numpy.int64 didn't

[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-03-15 Thread Siddhesh Poyarekar
Siddhesh Poyarekar added the comment: I forgot to clarify that the function cast warning allows for variable argument casts as a wildcard, which is my basis for the PyObject *(*)(PyObject *, PyObject *, ...) fix proposal. --

[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-03-15 Thread Siddhesh Poyarekar
Siddhesh Poyarekar added the comment: > The warning in GCC shouldn't probably have been enabled at all in `-Wall > -Wextra` because the cast is explicit. However, it is somewhat true. The explicit cast is precisely what enables the more nuanced function cast

Re: List slicing on Python 2.7

2018-03-15 Thread Arkadiusz Bulski
Found the answer on stack overflow. Some types on some runtimes (builtins and on Python 2) use another method __getslice__ instead of __getitem__. https://docs.python.org/2/reference/datamodel.html#object.__getslice__ czw., 15 mar 2018 o 12:54 użytkownik Arkadiusz Bulski

Re: List slicing on Python 2.7

2018-03-15 Thread Peter Otten
Ned Batchelder wrote: > On 3/15/18 9:57 AM, Vlastimil Brom wrote: >> 2018-03-15 12:54 GMT+01:00 Arkadiusz Bulski : >>> I have a custom class (a lazy list-like container) that needs to support >>> slicing. The __getitem__ checks if index is of slice type, and does a >>> list

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-15 Thread Tim Peters
Tim Peters added the comment: Serhiy, nobody is proposing to add float.as_integer(). It already exists: >>> (3.1).is_integer() False I already allowed I don't have a feel for how _generally_ useful it is, but you have at least my and Stefan's word for that the functionality

[issue33082] multiprocessing docs bury very important 'callback=' args

2018-03-15 Thread Chad
Chad added the comment: https://github.com/chadmiller-amzn/cpython/pull/1 (Putting that in "GitHub PR" field says "Edit Error: Unknown PR format, acceptable formats are: full github URL, #pr_number, pr_number") -- versions: +Python 3.4, Python 3.5

Re: Python gotcha of the day

2018-03-15 Thread Ben Finney
Thomas Jollans writes: > Then riddle me this: > > if """\"" is equivalent to "" + "\"" + "" + "", then why isn't > """ \""" """ equivalent to "" + " \"" + " " + ""? Who can say? I was only asked for an explanation, not a consistent one :-) Perhaps it's a micro-optimisation,

[issue27657] urlparse fails if the path is numeric

2018-03-15 Thread Cheryl Sabella
Change by Cheryl Sabella : -- stage: -> patch review versions: +Python 3.7, Python 3.8 -Python 3.5, Python 3.6 ___ Python tracker

[issue25735] math.factorial doc should mention integer return type

2018-03-15 Thread Mark Dickinson
Mark Dickinson added the comment: I opened #33083, and copied the nosy list from this issue across. -- ___ Python tracker ___

[issue33082] multiprocessing docs bury very important 'callback=' args

2018-03-15 Thread Mariatta Wijaya
Change by Mariatta Wijaya : -- versions: -Python 3.4, Python 3.5 ___ Python tracker ___

[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2018-03-15 Thread Henrique Andrade
New submission from Henrique Andrade : A simple example like such demonstrates that one of the file descriptors associated with the underlying pipe will be leaked: >>> from multiprocessing.queues import Queue >>> x = Queue() >>> x.close() Right after the queue is created

[issue25735] math.factorial doc should mention integer return type

2018-03-15 Thread Cheryl Sabella
Cheryl Sabella added the comment: Should the documentation patch for this be converted to a PR or does this need to change to a bug issue to address Mark's concerns? Thanks! -- nosy: +csabella stage: -> needs patch versions: +Python 3.7, Python 3.8 -Python 3.5

Re: List slicing on Python 2.7

2018-03-15 Thread Ned Batchelder
On 3/15/18 12:35 PM, Peter Otten wrote: Ned Batchelder wrote: On 3/15/18 9:57 AM, Vlastimil Brom wrote: 2018-03-15 12:54 GMT+01:00 Arkadiusz Bulski : I have a custom class (a lazy list-like container) that needs to support slicing. The __getitem__ checks if index is of

[issue33082] multiprocessing docs bury very important 'callback=' args

2018-03-15 Thread Chad
Change by Chad : -- keywords: +patch pull_requests: +5886 stage: -> patch review ___ Python tracker ___

[issue21611] int() docstring - unclear what number is

2018-03-15 Thread Cheryl Sabella
Cheryl Sabella added the comment: Is this superseded by issue 26701? -- nosy: +csabella ___ Python tracker ___

[issue25735] math.factorial doc should mention integer return type

2018-03-15 Thread Cheryl Sabella
Cheryl Sabella added the comment: Sounds good. Thanks, Mark. @mine0901, would you like to open a Github pull request for your patch? Thanks! -- ___ Python tracker

[issue33083] math.factorial accepts non-integral Decimal instances

2018-03-15 Thread Mark Dickinson
New submission from Mark Dickinson : Observed by Terry Reedy in the issue #25735 discussion (msg255479): >>> factorial(decimal.Decimal(5.2)) 120 This should be either raising an exception (either ValueError or TypeError, depending on whether we want to accept only integral

Re: number of loops

2018-03-15 Thread Dan Stromberg
On Thu, Mar 15, 2018 at 8:25 AM, Bob Gailer wrote: > On Mar 15, 2018 9:30 AM, wrote: >> >> I would like to have this offer 6 guesses, but instead it gives one guess > and prints the if statement/output 6 timesany ideas where I went wrong? > > I

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-15 Thread Ned Deily
Ned Deily added the comment: Nick, what's your assessment of this issue's priority? Is it a release blocker for 3.7.0b3 (proposed ABI freeze)? For 3.7.0rc1 (code freeze)? None of the above? -- nosy: +ned.deily ___ Python

[issue32799] returned a result with an error set

2018-03-15 Thread Eli Ribble
Eli Ribble added the comment: You can feel free to close the bug - I no longer work for the company that had this problem and I was only reporting the bug because the documentation specifically requested I do so. I don't have the ability now to try upgrading the version

Re: Context manager on method call from class

2018-03-15 Thread Rob Gaddi
On 03/15/2018 11:17 AM, Joseph L. Casale wrote: I have a class which implements a context manager, its __init__ has a signature and the __enter__ returns an instance of the class. Along with several methods which implement functionality on the instance, I have one method which itself must open

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-15 Thread Christian Heimes
Christian Heimes added the comment: /me bets his money on Stefan and Tim -- ___ Python tracker ___

[issue25735] math.factorial doc should mention integer return type

2018-03-15 Thread Mark Dickinson
Mark Dickinson added the comment: > Should the documentation patch for this be converted to a PR I think so, yes. How about we open a new issue for the factorial(Decimal(...)) behaviour, and keep this one focused on the original reported issue? --

[issue33082] multiprocessing docs bury very important 'callback=' args

2018-03-15 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Can you make your PR in python/cpython GitHub repo, instead of your own fork? -- nosy: +Mariatta ___ Python tracker

[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2018-03-15 Thread Henrique Andrade
Henrique Andrade added the comment: Correcting my original - after close(): > ll /proc/8096/fd total 0 dr-x-- 2 hcma hcma 0 2018-03-15 14:03:23.210089578 -0400 . dr-xr-xr-x 9 hcma hcma 0 2018-03-15 14:03:23.190089760 -0400 .. lrwx-- 1 hcma hcma 64 2018-03-15

Context manager on method call from class

2018-03-15 Thread Joseph L. Casale
I have a class which implements a context manager, its __init__ has a signature and the __enter__ returns an instance of the class. Along with several methods which implement functionality on the instance, I have one method which itself must open a context manager against a call on an instance

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am proposing to deprecate float.is_integer() and remove it in 3.10. After deprecating float.as_integer() we shouldn't bother about adding int.is_integer(). If this method is necessary in implementing various math libraries

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-15 Thread Tim Peters
Tim Peters added the comment: If you want to deprecate the method, bring that up on python-dev or python-ideas. It's inappropriate on the issue tracker (unless, e.g., you open a new issue with a patch to rip it out of the language). It's also inappropriate to keep on

[issue33082] multiprocessing docs bury very important 'callback=' args

2018-03-15 Thread Chad
New submission from Chad : Callbacks are really important in multiprocessing. Doc writer almost ignores them. -- assignee: docs@python components: Documentation messages: 313905 nosy: chadmiller-amzn, docs@python priority: normal severity: normal status: open

[issue33082] multiprocessing docs bury very important 'callback=' args

2018-03-15 Thread Ned Deily
Change by Ned Deily : -- nosy: +davin, pitrou versions: -Python 3.4, Python 3.5 ___ Python tracker ___

Re: Context manager on method call from class

2018-03-15 Thread Joseph L. Casale
From: Python-list on behalf of Rob Gaddi Sent: Thursday, March 15, 2018 12:47 PM To: python-list@python.org Subject: Re: Context manager on method call from class   > from contextlib import

Re: Python installer hangs in Windows 7

2018-03-15 Thread simon . wonng
On Monday, December 4, 2017 at 12:44:48 PM UTC-8, christian...@gmail.com wrote: > Same with me, except that I tried to install Python 3.6.3. Unchecking > "Install launcher for all users" helped, however. This worked for me, thanks! -- https://mail.python.org/mailman/listinfo/python-list

[issue33077] typing: Unexpected result with value of instance of class inherited from typing.NamedTuple

2018-03-15 Thread Eric V. Smith
Eric V. Smith added the comment: I once thought of building NamedTuple functionality into dataclasses, either as a parameter to @dataclass or as a new decorator. But it didn't get very far. It would have to return a different class, like NamedTuple does, and this didn't

[issue32642] add support for path-like objects in sys.path

2018-03-15 Thread Brett Cannon
Brett Cannon added the comment: Please open a separate issue for the test_poplib issue. -- ___ Python tracker ___

[issue33083] math.factorial accepts non-integral Decimal instances

2018-03-15 Thread John Yeung
Change by John Yeung : -- nosy: +John.Yeung ___ Python tracker ___ ___

[issue33083] math.factorial accepts non-integral Decimal instances

2018-03-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Many functions implemented in C accept Decimal instances. >>> chr(decimal.Decimal(65.2)) 'A' This is because PyLong_AsLong() and similar functions call __int__(). Floats are specially prohibited when convert arguments with

[issue33077] typing: Unexpected result with value of instance of class inherited from typing.NamedTuple

2018-03-15 Thread Guido van Rossum
Guido van Rossum added the comment: I wonder if it's too late to conclude that NamedTuple in this context should have been a class decorator rather than a base class. With a class decorator it's more understandable that the effect doesn't automatically apply to subclasses.

[issue33077] typing: Unexpected result with value of instance of class inherited from typing.NamedTuple

2018-03-15 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Yes, this is because subclassing `typing.NamedTuple` is not an actual subclassing, but is just a syntactic sugar for calling `collections.namedtuple`. A discussion about allowing subclassing/extending named tuples previously appeared

[issue33077] typing: Unexpected result with value of instance of class inherited from typing.NamedTuple

2018-03-15 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I would say it is too late. `typing.NamedTuple` is out there for more than a year and is quite actively used. A search on GitHub shows thousands of files that import `typing.NamedTuple` and a macroscopic fraction of those use it with

[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2018-03-15 Thread Henrique Andrade
Henrique Andrade added the comment: Pablo, but there is no way to close the other side. Indeed, if you look in the implementation, you will see that the writer file descriptor can't be closed. -- ___ Python tracker

Re: Python gotcha of the day

2018-03-15 Thread Python
On Thu, Mar 15, 2018 at 10:21:24AM +0100, Thomas Jollans wrote: > On 2018-03-15 07:11, Ben Finney wrote: > > Steven D'Aprano writes: > > > >> py> """\"" [...] > Then riddle me this: > > if """\"" is equivalent to "" + "\"" + "" + "", then why isn't

[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2018-03-15 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: The way is to delete the object. IMHO I would not say is "leaked" as the object is still alive and holds resources and these resources are properly handled on destruction. I cannot think of an immediate use case of closing both

[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2018-03-15 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Notice that the writer gets closed when it receives a sentinel value (which how the queue knows when to close as part of the design): >>> x.put(multiprocessing.queues._sentinel) If you call close after this line there will not be

[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2018-03-15 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Is not leaked as the object is still alive. Only one side is closed when you call "closed". If you destroy the object: >>> del x You will see that there are no more file descriptors in /proc/PID/fd associated with that queue.

[issue33083] math.factorial accepts non-integral Decimal instances

2018-03-15 Thread Stefan Krah
Change by Stefan Krah : -- nosy: -skrah ___ Python tracker ___ ___ Python-bugs-list

[issue33077] typing: Unexpected result with value of instance of class inherited from typing.NamedTuple

2018-03-15 Thread Guido van Rossum
Guido van Rossum added the comment: Apart from the fact that it's too late, if you had to do it over again, could it be done as a class decorator? Anyway, let's keep this issue open but reclassify it as a docs issue. -- ___ Python

[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2018-03-15 Thread Ned Deily
Change by Ned Deily : -- nosy: +davin, pitrou ___ Python tracker ___ ___ Python-bugs-list

[issue33079] subprocess: document the interaction between subprocess.Popen and os.set_inheritable

2018-03-15 Thread Ned Deily
Change by Ned Deily : -- nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list

[issue32968] Fraction modulo infinity should behave consistently with other numbers

2018-03-15 Thread Elias Zamaria
Elias Zamaria added the comment: Mark, I tried `Fraction(10**23) // 1e22`, and I got 10. Your `10**23 // 1e22` example was strange, but then `int(1e23)` and got 1611392. That is kind of unexpected but I think it is rare for anyone to do something like that

how do I retry a command only for a specific exception / error

2018-03-15 Thread Ganesh Pal
import time from functools import wraps from qa.utils.easy_popen import run def retry(ExceptionToCheck, tries=4, delay=5, backoff=2, logger=None): """ Retry calling the decorated function """ def deco_retry(f): @wraps(f) def f_retry(*args, **kwargs):

[issue33084] Computing median, median_high an median_low in statistics library

2018-03-15 Thread Luc
New submission from Luc : When a list or dataframe serie contains NaN(s), the median, median_low and median_high are computed in Python 3.6.4 statistics library, however, the results are wrong. Either, it should return a NaN just like when we try to compute a mean or point

Re: how do I retry a command only for a specific exception / error

2018-03-15 Thread Steven D'Aprano
On Fri, 16 Mar 2018 11:04:22 +0530, Ganesh Pal wrote: > All that I am trying to do here is write a generic function that will > re-retry > the command few more times before failing the test Something like this should do it. It gives up immediately on fatal errors and tries again on

[issue33080] regen-importlib is causing build races against other regen-all targets in Makefile.pre.in

2018-03-15 Thread Ned Deily
Change by Ned Deily : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list

[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

2018-03-15 Thread Eric V. Smith
Eric V. Smith added the comment: Yes, you're right, it can't be changed. And .port is documented as raising ValueError, so it's all working correctly. I think improving the ValueError message, as the PR does, is as good as we can do. --

[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

2018-03-15 Thread Eric V. Smith
Eric V. Smith added the comment: Wouldn't we be better off to catch this error at parse time, instead of just improve the error message when .port is called? I'm not sure why port is a property and not just computed. Maybe the least intrusive way of doing this would be to

Re: urllib.request.urlopen fails with https

2018-03-15 Thread Ned Deily
On 2018-03-14 18:04, Irv Kalb wrote: > File > "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", > line 1320, in do_open > raise URLError(err) > urllib.error.URLError: certificate verify failed (_ssl.c:749)> If you are using Python 3.6 for macOS from a

[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2018-03-15 Thread Henrique Andrade
Henrique Andrade added the comment: Unfortunately this is not the case. I will shrink my repro down to a more manageable size and post it here. -- ___ Python tracker

[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

2018-03-15 Thread Eric V. Smith
Eric V. Smith added the comment: Although having said that, we probably can't make that change for 2.7. And maybe it's even too big a change for 3.8. -- ___ Python tracker

[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

2018-03-15 Thread Matt Eaton
Matt Eaton added the comment: "Wouldn't we be better off to catch this error at parse time, instead of just improve the error message when .port is called?" I think there could be a case to be made about catching and dealing with this error in urlparse() / urlsplit()

[issue33036] test_selectors.PollSelectorTestCase failing on macOS 10.13.3

2018-03-15 Thread Ned Deily
Change by Ned Deily : -- resolution: -> works for me stage: -> resolved status: open -> closed ___ Python tracker ___

[issue32799] returned a result with an error set

2018-03-15 Thread Ned Deily
Change by Ned Deily : -- resolution: -> works for me stage: -> resolved status: open -> closed ___ Python tracker ___

Re: macOS specific - reading calendar information

2018-03-15 Thread Ned Deily
On 2018-03-15 03:58, Christian Gollwitzer wrote: > Am 15.03.18 um 08:32 schrieb Jan Erik Moström: >> I would like to read what calendar events I have on a range of days. I >> would like to get the data from whatever storage Calendar use, in my >> personal case I sync to iCloud. [...] > The native

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-15 Thread pmpp
Change by pmpp : -- nosy: +pmpp ___ Python tracker ___ ___ Python-bugs-list mailing list

Re: urllib.request.urlopen fails with https

2018-03-15 Thread Irv Kalb
On Mar 14, 2018, at 9:54 PM, Gregory Ewing wrote: > > Chris Angelico wrote: >> That means going back to the original problem: "how do we get a usable >> stock price API?". > > Does it have to be stock prices in particular? > Or just some simple piece of data that

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The use case of is_integer() still is not clear. Could you give examples of the correct use of this method in real projects? -- ___ Python tracker

[issue32421] Keeping an exception in cache can segfault the interpreter

2018-03-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > for _ ∈ range(5): What version of Python are you using? -- ___ Python tracker

[issue32421] Keeping an exception in cache can segfault the interpreter

2018-03-15 Thread Julien Palard
Julien Palard added the comment: Serhiy: Sorry the ∈ comes from emacs' pretty-mode, I should copy from outside emacs. Version tested are listed in my previous message. -- ___ Python tracker

[issue27984] singledispatch register should typecheck its argument

2018-03-15 Thread Cheryl Sabella
Cheryl Sabella added the comment: Łukasz, Sorry about that. Since Xiang is a core developer, I thought he would be in the position to make the decision about moving forward with the patch. I apologize for causing unnecessary work. --

[issue32328] ttk.Treeview: _tkinter.TclError: list element in quotes followed by "; " instead of space

2018-03-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: According to the documentation (https://www.tcl.tk/man/tcl/TkCmd/ttk_treeview.htm) the item option "values" is "The list of values associated with the item.", and the item option "tags" is "A list of tags associated with this

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-15 Thread Robert Smallshire
Change by Robert Smallshire : -- pull_requests: +5885 stage: needs patch -> patch review ___ Python tracker ___

[issue33042] New 3.7 startup sequence crashes PyInstaller

2018-03-15 Thread Nick Coghlan
Nick Coghlan added the comment: Patched test_capi results for 2ebc5ce42a8a9e047e790aefbf9a94811569b2b6 (the global state consolidation commit): both pre-initialization tests fail Patched test_capi results for bab21faded31c70b142776b9a6075a4cda055d7f (the immediately

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-15 Thread Robert Smallshire
Robert Smallshire added the comment: Python in effect contains an example itself. The math.factorial(x) function contains what is in-effect an is_integer() check as a guard. -- ___ Python tracker

[issue32968] Fraction modulo infinity should behave consistently with other numbers

2018-03-15 Thread Mark Dickinson
Mark Dickinson added the comment: Yes, that sort of thing is going to happen as soon as floating-point enters the mix. There will be surprises from Fraction % float as well as float % Fraction: >>> from fractions import Fraction >>> Fraction(10**23) // 1e22 9.0 And that's

[issue33069] Maintainer information discarded when writing PKG-INFO

2018-03-15 Thread Nick Coghlan
Nick Coghlan added the comment: We allowed semi-standardised additional fields for an extended period with 1.2 (for Provides-Extra and Description-Content-Type), but folks mostly found it confusingly ambiguous, so Dustin created PEP 566 to define them officially as

[issue33079] subprocess: document the interaction between subprocess.Popen and os.set_inheritable

2018-03-15 Thread Simon Lipp
New submission from Simon Lipp : >From current `os` documentation: > A file descriptor has an “inheritable” flag which indicates if the file > descriptor can be inherited by child processes from current `subprocess` documentation: > If close_fds is true, all file

[issue27984] singledispatch register should typecheck its argument

2018-03-15 Thread Xiang Zhang
Xiang Zhang added the comment: Cheryl, It's a good remind for me. I totally forget about this issue. > Since Xiang is a core developer, I thought he would be in the position to > make the decision about moving forward with the patch. Yes, I made the decision. But seems not

[issue33078] Queue with maxsize can lead to deadlocks

2018-03-15 Thread Thomas Moreau
New submission from Thomas Moreau : The fix for the Queue._feeder does not properly handle the size of the Queue. This can lead to a situation where the Queue is considered as Full when it is empty. Here is a reproducing script: ``` import multiprocessing as mp

[issue33078] Queue with maxsize can lead to deadlocks

2018-03-15 Thread Thomas Moreau
Change by Thomas Moreau : -- keywords: +patch pull_requests: +5883 stage: -> patch review ___ Python tracker ___

Re: Python gotcha of the day

2018-03-15 Thread Ben Finney
Steven D'Aprano writes: > py> """\"" > '"' That's an empty string delimited by ‘"’; followed by a double-quote character, escaped, delimited by ‘"’; followed by two more empty strings. They concatenate to a single one-character string. Equivalent to

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: math.factorial() doesn't use float.is_integer(). -- ___ Python tracker ___

Re: Enumerating all 3-tuples (Posting On Python-List Prohibited)

2018-03-15 Thread Ben Bacarisse
Lawrence D’Oliveiro writes: > On Thursday, March 15, 2018 at 2:56:24 PM UTC+13, Ben Bacarisse wrote: >> >> Lawrence D’Oliveiro writes: >> >>> On Wednesday, March 14, 2018 at 2:18:24 PM UTC+13, Ben Bacarisse wrote: >>> Lawrence D’Oliveiro writes: The

[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-03-15 Thread Antti Haapala
Antti Haapala added the comment: I don't have GCC 8 so I cannot verify this bug, but *function pointer casts* are fine - any function pointer can be cast to any other function pointer - it is only that they must *not* be called unless cast back again to be compatible with

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If float.is_integer() is useful in numerical code please give me few examples. I don't take your argument about mpd_as_integer() in the Decimal class. Decimal has a lot of methods which makes sense for Decimal. >>>

[issue32608] Incompatibilities with the socketserver and multiprocessing packages

2018-03-15 Thread Michael Durso
Michael Durso added the comment: Hi Antoine, no worries for the delay. I've been looking into why the AppVeyor check is failing. I believe it to be an issue with the test harness in that it changes the environment during the tests, but only in the Windows case. I

[issue33073] Add as_integer_ratio() to int() objects

2018-03-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Adding as_integer_ratio() to numbers.Rational is a breaking change. It breaks the interface. Currently all numbers.Rational subclasses implement all public methods and properties of the abstract class, but with adding

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2018-03-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: mpd_as_integer() is used internally in the Decimal class. Do you have use cases for it outside of the Decimal class? And the question was about using float.is_integer(). I have not found *any* sane example on GitHub. The most

List slicing on Python 2.7

2018-03-15 Thread Arkadiusz Bulski
I have a custom class (a lazy list-like container) that needs to support slicing. The __getitem__ checks if index is of slice type, and does a list comprehension over individual integer indexes. The code works fine on Python 3 but fails on 2.7, both CPython and PyPy. The print inside __getitem__

[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-03-15 Thread Siddhesh Poyarekar
Siddhesh Poyarekar added the comment: > I don't have GCC 8 so I cannot verify this bug, but *function pointer casts* > are fine - any function pointer can be cast to any other function pointer - > it is only that they must *not* be called unless cast back again

Re: Homebrew changed default Python to python 3!

2018-03-15 Thread INADA Naoki
FYI, they reverted python->python3 symlink. python command is now Python 2 again. https://discourse.brew.sh/t/python-and-pep-394/1813 Even though this revert, it is significant step: * many formulas dropped `depends_on "python"`. Python 2 was installed often by dependency before but it's rare

  1   2   >