[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

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):

[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

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 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

[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. --

[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 ___

[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

[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

[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 ___

[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

[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()

[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

[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

[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

[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

[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 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

[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 ___

[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

[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

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

[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

[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

[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.

[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 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

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

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

[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 ___

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

[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 ___

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

[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

[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

[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 ___

[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

[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

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

[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? --

[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: 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

[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 ___

[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 ___

[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

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,

[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

[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 ___

[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

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 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

[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

[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

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 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

[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

[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

[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

[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

[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 ___

[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

[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

[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

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

[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

[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 -- ___

[issue33042] New 3.7 startup sequence crashes PyInstaller

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

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

[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

[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: 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

[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

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

2018-03-15 Thread Jay Yin
Jay Yin added the comment: it seems to me like the issue in my tests is that some SSL thing is failing?, anyone have any experience with this? -- ___ Python tracker

Re: number of loops

2018-03-15 Thread Bob Gailer
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 suggest you conduct a walk-through. That means pointing using a pencil or a mouse

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

2018-03-15 Thread Antti Haapala
Antti Haapala added the comment: Yea, I looked into `ceval.c` and the function is *called incorrectly*, so there is undefined behaviour there - it has been wrong all along, in 3.5 all the way down to 2-something if (flags & (METH_NOARGS | METH_O)) {

Re: List slicing on Python 2.7

2018-03-15 Thread Ned Batchelder
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 comprehension over individual

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

2018-03-15 Thread Jay Yin
Jay Yin added the comment: https://pastebin.com/q4FKnPZH the trace for the test_poplib -- ___ Python tracker ___

[issue33057] logging.Manager.logRecordFactory is never used

2018-03-15 Thread Vinay Sajip
Vinay Sajip added the comment: > I have two types of loggers, one for experiment results ("data") and another > for general information In what way is the behaviour of the two types of logger different? I'm concerned that this might be an XY problem ... --

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

2018-03-15 Thread Jay Yin
Jay Yin added the comment: I'm having issues with my local changes for my PR, I'm unsure why my local machine takes a seemingly infinite amount of time on test_poplib, so again I think something to do with my local environment is causing issues again, any help would be

Re: List slicing on Python 2.7

2018-03-15 Thread Vlastimil Brom
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 > comprehension over individual integer indexes. The code works fine on >

number of loops

2018-03-15 Thread michealmancini
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? import random number_of_guesses = 0 print ('Hello! what is your name?') my_name=input() print (my_name + " " + 'sounds like the name of my next

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

2018-03-15 Thread Facundo Batista
Change by Facundo Batista : -- nosy: -facundobatista ___ Python tracker ___ ___

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

2018-03-15 Thread Robert Smallshire
Robert Smallshire added the comment: Serhiy, you asked for use cases, not uses. The former can exist without the latter. Use cases for is_integer() include all existing uses of x == int(x), or other less obvious means of detecting integer values. Folks try to use

Re: Enumerating all 3-tuples

2018-03-15 Thread Denis Kasak
On 2018-03-13 23:56, Denis Kasak wrote: On 2018-03-10 02:13, Steven D'Aprano wrote: But I've stared at this for an hour and I can't see how to extend the result to three coordinates. I can lay out a grid in the order I want: 1,1,1 1,1,2 1,1,3 1,1,4 ... 2,1,1 2,1,2 2,1,3 2,1,4

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

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

[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. >>>

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

2018-03-15 Thread Stefan Krah
Stefan Krah added the comment: libmpdec is an example of numerical code. I don't think anyone but you has argued that is_integer() is useless in numerical code. Whether it is float or decimal doesn't matter. I get the API-bloat argument, but I'm completely surprised

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

2018-03-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- dependencies: +Questionable code in OrderedDict definition ___ Python tracker ___

[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

[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__

[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

[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

[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 Stefan Krah
Stefan Krah added the comment: In effect: "!(Py_IS_FINITE(dx) && dx == floor(dx))" I don't understand why Robert is questioned so much. mpd_as_integer() (or rather the optimized version _mpd_isint() is used all over the place inside libmpdec's own numeric code.

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

[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 ___

  1   2   >