Re: asyncio and subprocesses

2016-04-24 Thread Terry Reedy
On 4/24/2016 6:07 PM, David wrote: Is this a bug in the asyncio libraries? Is this a fixed bug, already? I am using Python 3.4.2 as distributed in Ubuntu Lucid, with built-in asyncio. The people who patch asyncio do not read this list. Either install a current release or try the tulip

[issue20430] Make argparse.SUPPRESS work as an argument "dest"

2016-04-24 Thread paul j3
paul j3 added the comment: I just found a case where `dest` is `SUPPRESS` - the default subparsers setup. _SubParsersAction(option_strings=[], dest='==SUPPRESS==', nargs='A...', ... If I make this Action 'required' (in the current distribution 'subparsers' are not required - there's a

[issue24114] ctypes.utils uninitialized variable 'paths'

2016-04-24 Thread Berker Peksag
Changes by Berker Peksag : -- keywords: +easy versions: +Python 3.5, Python 3.6 ___ Python tracker ___

[issue24331] *** Error in `/usr/bin/python': double free or corruption (!prev): 0x0000000000f5c760 *** when cloning hg repository into directory on cifs

2016-04-24 Thread Berker Peksag
Berker Peksag added the comment: Agreed, this is unlikely an issue with Python. Please report it to Mercurial developers. -- nosy: +berker.peksag resolution: -> third party stage: -> resolved status: open -> closed ___ Python tracker

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-24 Thread Derek Klinge
So I tried the recommended limit approach and got some interesting results. ## Write a method to approximate Euler's Number using Euler's Method import math class EulersNumber(): def __init__(self,n): self.n = n self.e = 2 def linearApproximation(self,x,h,d): # f(x+h)=f(x)+h*f'(x) return x + h *

[issue23961] IDLE autocomplete window does not automatically close when selection is made

2016-04-24 Thread Berker Peksag
Changes by Berker Peksag : -- stage: -> resolved status: open -> closed superseder: -> IDLE code completion window can hang or misbehave with mouse ___ Python tracker

[issue11063] uuid.py module import has heavy side effects

2016-04-24 Thread Martin Panter
Martin Panter added the comment: One thing I am wondering about is why we have to use find_library() at all. Wouldn’t it be more robust, and more efficient, to call CDLL() directly? We just have to know the exactly library version we are expecting. On Linux, the full soname is libuuid.so.1.

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-04-24 Thread Martin Panter
Martin Panter added the comment: Maybe Issue 21826 is relevant (slowdown on AIX caused by missing ldconfig) -- nosy: +martin.panter ___ Python tracker

[issue21826] Performance issue (+fix) AIX ctypes.util with no /sbin/ldconfig present

2016-04-24 Thread Martin Panter
Martin Panter added the comment: See also Issue 26439 about find_library() AIX support -- nosy: +martin.panter ___ Python tracker ___

[issue21622] ctypes.util incorrectly fails for libraries without DT_SONAME

2016-04-24 Thread Martin Panter
Martin Panter added the comment: On Linux, the find_library() function is documented to return “the filename of the library file”, but in reality it seems it return the soname, and therefore breaks if there is no soname. I do not know why we extract the soname, but it has been that way at

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-24 Thread Derek Klinge
Actually, I'm not trying to speed it up, just be able to handle a large number of n. (Thank you Chris for the suggestion to use xrange, I am on a Mac using the stock Python 2.7) I am looking at the number of iterations of linear approximation that are required to get a more accurate

[issue19317] ctypes.util.find_library should examine binary's RPATH on Solaris

2016-04-24 Thread Martin Panter
Martin Panter added the comment: find_library() is documented as emulating the build-time linker, and I suspect the RPATH of the Python executable is not relevant at build time. See also Issue 9998 and Issue 18502. -- nosy: +martin.panter ___

[issue9998] ctypes find_library should search LD_LIBRARY_PATH on linux

2016-04-24 Thread Martin Panter
Martin Panter added the comment: I also found Issue 18502 essentially about the same incompatibility between CDLL() and find_library(). The problem I see with using find_library() to blindly load a library is that you could be loading an incompatible version (wrong soname). That is why I

[issue26843] tokenize does not include Other_ID_Start or Other_ID_Continue in identifier

2016-04-24 Thread Joshua Landau
New submission from Joshua Landau: This is effectively a continuation of https://bugs.python.org/issue9712. The line in Lib/tokenize.py Name = r'\w+' must be changed to a regular expression that accepts Other_ID_Start at the start and Other_ID_Continue elsewhere. Hence tokenize does not

[issue26793] uuid causing thread issues when forking using os.fork py3.4+

2016-04-24 Thread Steven Adams
Steven Adams added the comment: anyone got any other thoughts on this?? -- ___ Python tracker ___ ___

[issue18502] CDLL does not use same paths as util.find_library

2016-04-24 Thread Martin Panter
Martin Panter added the comment: Documenting this quirk seems reasonable to me if you want to suggest a patch (and we don’t agree to fix it). See Issue 21042 for returning full paths on Linux. We tried to make this change, but it wasn’t easy to do it consistently for arbitrary ABIs, so I

[issue6338] Error message displayed on stderr when no C compiler is present with ctypes

2016-04-24 Thread Martin Panter
Martin Panter added the comment: It would be good to close the file when it’s no longer needed. Also, if this bug is relevant to Python 3, I would use open() rather than file(). -- nosy: +martin.panter stage: -> patch review ___ Python tracker

[issue24114] ctypes.utils uninitialized variable 'paths'

2016-04-24 Thread Martin Panter
Changes by Martin Panter : -- stage: patch review -> needs patch title: ctypes.utils uninitialized variable 'path' -> ctypes.utils uninitialized variable 'paths' type: -> behavior ___ Python tracker

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-04-24 Thread Eric Hanchrow
Changes by Eric Hanchrow : -- nosy: +Eric.Hanchrow ___ Python tracker ___ ___

[issue21622] ctypes.util incorrectly fails for libraries without DT_SONAME

2016-04-24 Thread Kylie McClain
Kylie McClain added the comment: This is still a problem on musl distributions as of 2.7.11. Are there any plans to fix this? Patch used by Alpine Linux: http://git.alpinelinux.org/cgit/aports/tree/main/python/musl-find_library.patch -- nosy: +Kylie McClain

Re: How much sanity checking is required for function inputs?

2016-04-24 Thread Michael Selik
On Sun, Apr 24, 2016 at 2:08 PM Steven D'Aprano wrote: > On Sun, 24 Apr 2016 04:40 pm, Michael Selik wrote: > > I think we're giving mixed messages because we're conflating > "constants" and globals that are expected to change. > > When you talk about "state", that usually

[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-24 Thread Martin Panter
Martin Panter added the comment: Yes that was my rambling way of saying that I had checked to see if they were in the right place, and reporting that it was all okay :) New patch seems okay to me. -- ___ Python tracker

[issue26800] Don't accept bytearray as filenames part 2

2016-04-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3fb0f9a0b195 by Guido van Rossum in branch 'default': Rip out the promotion from bytearray/memoryview to bytes. See http://bugs.python.org/issue26800. https://hg.python.org/peps/rev/3fb0f9a0b195 -- nosy: +python-dev

[issue26800] Don't accept bytearray as filenames part 2

2016-04-24 Thread Guido van Rossum
Guido van Rossum added the comment: Sigh, I was wrong, not only does mypy promote bytearray to bytes, it actually depends on this in its own code. Not for filenames, but for a regex match. It reads the source into a bytearray, and then passes that to something that uses regex matches (which *do*

[issue26837] assertSequenceEqual() raises BytesWarning when format message

2016-04-24 Thread Martin Panter
Martin Panter added the comment: I think the change is good in spirit, especially using repr() and limiting the size. See the review for a couple problems. -- nosy: +martin.panter stage: -> patch review ___ Python tracker

[issue26800] Don't accept bytearray as filenames part 2

2016-04-24 Thread Guido van Rossum
Guido van Rossum added the comment: OK, it isn't worth fighting for. I will update PEP 484. It seems mypy doesn't support the special treatment bytearray anyway. For posterity, the reason I thought that bytearray should be accepted is not that bytearray is better in any way, just that sometimes

[issue26842] Python Tutorial 4.7.1: Need to explain default parameter lifetime

2016-04-24 Thread Edward Segall
New submission from Edward Segall: I am using the tutorial to learn Python. I know many other languages, and I've taught programming language theory, but even so I found the warning in Section 4.7.1 about Default Argument Values to be confusing. After I spent some effort investigating what

Re: Scraping email to make invoice

2016-04-24 Thread Michael Torrie
On 04/24/2016 12:58 PM, CM wrote: > 1. INPUT: What's the best way to scrape an email like this? The > email is to a Gmail account, and the content shows up in the email as > a series of basically 6x7 tables (HTML?), one table per PO > number/task. I know if the freelancer were to copy and paste

Re: Python TUI that will work on DOS/Windows and Unix/Linux

2016-04-24 Thread Peter Brittain
I noticed this trail on Google... if you're still interested, you could try out https://github.com/peterbrittain/asciimatics I ported it to Windows from Linux so exactly the same API works on both. -- https://mail.python.org/mailman/listinfo/python-list

[issue12305] Building PEPs doesn't work on Python 3

2016-04-24 Thread Berker Peksag
Berker Peksag added the comment: peps repo is now Python 3 compatible. Related commits: * https://github.com/python/peps/commit/88f9f6da5d51a36d0f6a1bb833a6e8c85763c7d2 * https://github.com/python/peps/commit/3e5cad857053e0c15b2621dae728f32b4099c1a5 -- nosy: +berker.peksag resolution:

Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 54:

2016-04-24 Thread Peter Otten
arthur sherman wrote: > m using a python web applic (adagios, a nagios configuration tool). > when attempting a certain operation on the client side browser i get the > above error. the client side is ubunti 14.04. servers side is debian 8. > browser is ff or chrome. both show: > echo $LANG >

asyncio and subprocesses

2016-04-24 Thread David
Is this a bug in the asyncio libraries? This code: ''' proc = yield from asyncio.create_subprocess_exec(*cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env) # read all data from subprocess pipe, copy to nextCoro ln = yield from proc.stdout.read(1024) while ln:

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-24 Thread Oscar Benjamin
On 24 April 2016 at 19:21, Chris Angelico wrote: > On Mon, Apr 25, 2016 at 4:03 AM, Derek Klinge wrote: >> Ok, from the gmail web client: > > Bouncing this back to the list, and removing quote markers for other > people's copy/paste convenience. > > ##

[issue26822] itemgetter/attrgetter/methodcaller objects ignore keyword arguments

2016-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch that adds fast checks before calling _PyArg_NoKeywords(). Other option is redefine _PyArg_NoKeywords as a macro: #define _PyArg_NoKeywords(name, kw) ((kw) != NULL && _PyArg_NoKeywords((name), (kw))) This will affect all usages of

Re: Scraping email to make invoice

2016-04-24 Thread Friedrich Rentsch
On 04/24/2016 08:58 PM, CM wrote: I would like to write a Pythons script to automate a tedious process and could use some advice. The source content will be an email that has 5-10 PO (purchase order) numbers and information for freelance work done. The target content will be an invoice.

[issue26249] Change PyMem_Malloc to use pymalloc allocator

2016-04-24 Thread STINNER Victor
STINNER Victor added the comment: I documented the change, buildbots are happy, I close the issue. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue26840] Hidden test in test_heapq

2016-04-24 Thread Berker Peksag
Berker Peksag added the comment: This is a duplicate of issue 19119. -- nosy: +berker.peksag resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> duplicate test name in Lib/test/test_heapq.py ___ Python

[issue26841] Hidden test in ctypes tests

2016-04-24 Thread Berker Peksag
Berker Peksag added the comment: This is a duplicate of issue 19113. -- nosy: +berker.peksag resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> duplicate test names in Lib/ctypes/test/test_functions.py ___ Python

[issue26249] Change PyMem_Malloc to use pymalloc allocator

2016-04-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7acad5d8f80e by Victor Stinner in branch 'default': Issue #26249: Mention PyMem_Malloc() change in What's New in Python 3.6 in the https://hg.python.org/cpython/rev/7acad5d8f80e -- ___ Python tracker

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 54:

2016-04-24 Thread arthur sherman
m using a python web applic (adagios, a nagios configuration tool). when attempting a certain operation on the client side browser i get the above error. the client side is ubunti 14.04. servers side is debian 8. browser is ff or chrome. both show: echo $LANG en_US.UTF-8 before i dive into the

[issue26698] Tk DPI awareness

2016-04-24 Thread Westley Martínez
Westley Martínez added the comment: IDLE 3.5.1 on Windows 10 -- ___ Python tracker ___ ___ Python-bugs-list

[issue26841] Hidden test in ctypes tests

2016-04-24 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: There are two methods named "test_errors" in FunctionTestCase in Lib/ctypes/test/test_functions.py. The latter hides the former. -- components: Tests messages: 264127 nosy: amaury.forgeotdarc, belopolsky, meador.inge, serhiy.storchaka priority:

Re: Remove directory tree without following symlinks

2016-04-24 Thread eryk sun
On Sun, Apr 24, 2016 at 5:42 AM, Albert-Jan Roskam wrote: > Aww, I kinda forgot about that already, but I came across this last > year [1]. Apparently, shutil.rmtree(very_long_path) failed under Win 7, > even with the "silly prefix". I believe very_long_path was a >

[issue26839] python always calls getrandom() at start, causing long hang after boot

2016-04-24 Thread STINNER Victor
STINNER Victor added the comment: Python 3 uses os.urandom() at startup to randomize the hash function. os.urandom() now uses the new Linux getrandom() function which blocks until the Linux kernel is feeded with enough entropy. It's a deliberate choice. The workaround is simple: set the

[issue26822] itemgetter/attrgetter/methodcaller objects ignore keyword arguments

2016-04-24 Thread Raymond Hettinger
Raymond Hettinger added the comment: In general there should be an early out test for keywords==NULL before calling the comparatively high overhead function _PyArg_NoKeywords. That function adds overhead everywhere it is used and provides zero benefit to correct programs in order to provide

[issue26800] Don't accept bytearray as filenames part 2

2016-04-24 Thread STINNER Victor
STINNER Victor added the comment: I'm really sceptical that anyone really use bytearray for filenames in Python. I'm quite sure that most functions fail with bytearray. Do you have an example of application using bytearray? What's the point of using bytearray? To limit memory copy and

[issue26840] Hidden test in test_heapq

2016-04-24 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: There are two methods test_get_only in TestErrorHandling in test_heapq. The latter hides the former. There is only one test_get_only in 2.7. -- assignee: rhettinger components: Tests messages: 264123 nosy: rhettinger, serhiy.storchaka priority:

[issue26839] python always calls getrandom() at start, causing long hang after boot

2016-04-24 Thread Matthias Klose
Matthias Klose added the comment: other issues fixed between these dates: - Issue #26659: Make the builtin slice type support cycle collection. - Issue #26718: super.__init__ no longer leaks memory if called multiple times. NOTE: A direct call of super.__init__ is not endorsed!

[issue26839] python always calls getrandom() at start, causing long hang after boot

2016-04-24 Thread Matthias Klose
New submission from Matthias Klose: [forwarded from https://bugs.debian.org/822431] This regression / change of behaviour was seen between 20160330 and 20160417 on the 3.5 branch. The only check-in which could affect this is the fix for issue #26735. 3.5.1-11 = 20160330 3.5.1-12 = 20160417

Scraping email to make invoice

2016-04-24 Thread CM
I would like to write a Pythons script to automate a tedious process and could use some advice. The source content will be an email that has 5-10 PO (purchase order) numbers and information for freelance work done. The target content will be an invoice. (There will be an email like this every

Re: Comparing Python enums to Java, was: How much sanity checking is required for function inputs?

2016-04-24 Thread Ian Kelly
On Sun, Apr 24, 2016 at 10:04 AM, Ethan Furman wrote: > On 04/24/2016 08:20 AM, Ian Kelly wrote: >> * Java doesn't have the hokey notion of enum instances being distinct >> from their "value". The individual enum members *are* the values. >> Whereas in Python an enum member is

Re: from __future__ import print_function

2016-04-24 Thread Ethan Furman
On 04/24/2016 11:14 AM, Joel Goldstick wrote: On Sun, Apr 24, 2016 at 2:05 PM, San wrote: I want details explanation(why this statement used,when it can be used,etc) of following statement in python code "from __future__ import print_function" It lets python 2.7 use python 3.x print

Re: Comparing Python enums to Java, was: How much sanity checking is required for function inputs?

2016-04-24 Thread Ethan Furman
On 04/24/2016 11:27 AM, Chris Angelico wrote: On Mon, Apr 25, 2016 at 4:12 AM, Ethan Furman wrote: Values can be anything. The names are immutable and hashable. I know they *can* be, because I looked in the docs; but does it make sense to a human? Sure, we can legally do this: Well, not

[issue23277] Cleanup unused and duplicate imports in tests

2016-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Berker. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement ___ Python tracker

[issue23277] Cleanup unused and duplicate imports in tests

2016-04-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset fa44d1bc9b68 by Serhiy Storchaka in branch 'default': Issue #23277: Remove unused imports in tests. https://hg.python.org/cpython/rev/fa44d1bc9b68 -- ___ Python tracker

Re: Comparing Python enums to Java, was: How much sanity checking is required for function inputs?

2016-04-24 Thread Chris Angelico
On Mon, Apr 25, 2016 at 4:12 AM, Ethan Furman wrote: > On 04/24/2016 09:47 AM, Chris Angelico wrote: > >> I would normally expect enumerated values to be immutable and >> hashable, but that isn't actually required by the code AIUI. Under >> what circumstances is it useful to

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-24 Thread Chris Angelico
On Mon, Apr 25, 2016 at 4:03 AM, Derek Klinge wrote: > Ok, from the gmail web client: Bouncing this back to the list, and removing quote markers for other people's copy/paste convenience. ## Write a method to approximate Euler's Number using Euler's Method import math

[issue26800] Don't accept bytearray as filenames part 2

2016-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The os.path module and os.fsdecode() don't support bytearray paths. Should we add bytearray support? This will complicate and slowdown os.path functions which often are used multiple times in tight loops. Correspondingly, many Python implemented functions

[issue26739] idle: Errno 10035 a non-blocking socket operation could not be completed immediately

2016-04-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: Kristján, thank you for the response. The socket communication part of IDLE is pretty much a black box to me. Just to clarify, you are saying that select polling is only needed for non-blocking sockets; sockets are blocking by default; and you see no

Re: from __future__ import print_function

2016-04-24 Thread Joel Goldstick
On Sun, Apr 24, 2016 at 2:05 PM, San wrote: > Hi All, > I want details explanation(why this statement used,when it can be used,etc) > of following statement in python code > > "from __future__ import print_function" > > Thanks in advance. > -- >

Re: Comparing Python enums to Java, was: How much sanity checking is required for function inputs?

2016-04-24 Thread Ethan Furman
On 04/24/2016 09:47 AM, Chris Angelico wrote: I would normally expect enumerated values to be immutable and hashable, but that isn't actually required by the code AIUI. Under what circumstances is it useful to have mutable enum values? Values can be anything. The names are immutable and

from __future__ import print_function

2016-04-24 Thread San
Hi All, I want details explanation(why this statement used,when it can be used,etc) of following statement in python code "from __future__ import print_function" Thanks in advance. -- https://mail.python.org/mailman/listinfo/python-list

Re: How much sanity checking is required for function inputs?

2016-04-24 Thread Steven D'Aprano
On Sun, 24 Apr 2016 04:40 pm, Michael Selik wrote: > I think we're giving mixed messages because we're conflating "constants" > and globals that are expected to change. When you talk about "state", that usually means "the current state of the program", not constants. math.pi is not "state". >

Re: Comparing Python enums to Java, was: How much sanity checking is required for function inputs?

2016-04-24 Thread Chris Angelico
On Mon, Apr 25, 2016 at 3:54 AM, BartC wrote: > On 24/04/2016 17:47, Chris Angelico wrote: >> >> On Mon, Apr 25, 2016 at 2:42 AM, Ethan Furman wrote: Easy: allow an empty list to have the same meaning as an empty tuple. Every time you have []

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-24 Thread Chris Angelico
On Mon, Apr 25, 2016 at 3:56 AM, Derek Klinge wrote: > Doesn't range(n) create a list n long? Not in Python 3. If your code is running on Python 2, use xrange instead of range. I rather doubt that's your problem, though. ChrisA --

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-24 Thread Derek Klinge
Doesn't range(n) create a list n long? On Sun, Apr 24, 2016 at 10:21 AM Chris Angelico wrote: > On Mon, Apr 25, 2016 at 3:02 AM, Derek Klinge > wrote: > > My problem is this: my attempt at Euler's Method involves creating a > list of > > numbers that is n

Re: Comparing Python enums to Java, was: How much sanity checking is required for function inputs?

2016-04-24 Thread BartC
On 24/04/2016 17:47, Chris Angelico wrote: On Mon, Apr 25, 2016 at 2:42 AM, Ethan Furman wrote: Easy: allow an empty list to have the same meaning as an empty tuple. Every time you have [] in your source code, you're guaranteed to get a new (unique) empty list, and then

[issue23277] Cleanup unused and duplicate imports in tests

2016-04-24 Thread Berker Peksag
Berker Peksag added the comment: LGTM -- ___ Python tracker ___ ___ Python-bugs-list mailing list

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-24 Thread Chris Angelico
On Mon, Apr 25, 2016 at 3:02 AM, Derek Klinge wrote: > My problem is this: my attempt at Euler's Method involves creating a list of > numbers that is n long. Is there a way I can iterate over the linear > approximation method without creating a list of steps (maybe

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-24 Thread Chris Angelico
On Mon, Apr 25, 2016 at 3:06 AM, Derek Klinge wrote: > I think my e-mail client may be stripping the indentation, here it is with > 4-space indentation I think it is. Both your reposted versions have indentation lost. You may need to use a different client. My posts come

Challenge: Shadow lots of built-ins

2016-04-24 Thread Chris Angelico
This is mostly just for the fun of it, but every now and then I have a discussion with people about why it's legal to shadow Python's built-in names, and it'd be handy to have a go-to piece of demo code. So here's the challenge: Write a short, readable block of code that shadows as many built-ins

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-24 Thread Derek Klinge
I think my e-mail client may be stripping the indentation, here it is with 4-space indentation ## Write a method to approximate Euler's Number using Euler's Method import math class EulersNumber(): def __init__(self,n): self.eulerSteps = n self.e = self.EulersMethod(self.eulerSteps) def

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-24 Thread Derek Klinge
Sorry about the code indentation, I was using Pythonista (iOS), and it did not have any problem with that indentation... Here is a new set of the code: ## Write a method to approximate Euler's Number using Euler's Method import math class EulersNumber(): def __init__(self,n): self.eulerSteps = n

Re: Comparing Python enums to Java, was: How much sanity checking is required for function inputs?

2016-04-24 Thread Chris Angelico
On Mon, Apr 25, 2016 at 2:42 AM, Ethan Furman wrote: >> Easy: allow an empty list to have the same meaning as an empty tuple. >> Every time you have [] in your source code, you're guaranteed to get a >> new (unique) empty list, and then multiple assignment will work. > > >

Re: Comparing Python enums to Java, was: How much sanity checking is required for function inputs?

2016-04-24 Thread Ethan Furman
On 04/24/2016 09:10 AM, Chris Angelico wrote: On Mon, Apr 25, 2016 at 2:04 AM, Ethan Furman wrote: Unfortunately, the empty tuple tends to be a singleton, so there is no way to tell that red and default are (supposed to be) the same and blue is (supposed to be) different:

[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-24 Thread Hans-Peter Jansen
Hans-Peter Jansen added the comment: > In Python 2, it looks like the proxy_bypass_etc() functions are defined > in urllib and imported into urllib2, so it makes sense to include the > tests in test_urllib rather than test_urllib2. The tests are in test_urllib. test_urllib2 is testing proxy

[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-24 Thread Hans-Peter Jansen
Hans-Peter Jansen added the comment: * blatant error fixed * one test case added -- Added file: http://bugs.python.org/file42582/python-urllib-prefer-lowercase-proxies-v6.diff ___ Python tracker

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-24 Thread Chris Angelico
On Sun, Apr 24, 2016 at 1:05 PM, Derek Klinge wrote: > I have been writing a python script to explore Euler's Method of > approximating Euler's Number. I was hoping there might be a way to make > this process work faster, as for sufficiently large eulerSteps, the process >

Re: Comparing Python enums to Java, was: How much sanity checking is required for function inputs?

2016-04-24 Thread Chris Angelico
On Mon, Apr 25, 2016 at 2:04 AM, Ethan Furman wrote: > Unfortunately, the empty tuple tends to be a singleton, so there is no way > to tell that red and default are (supposed to be) the same and blue is > (supposed to be) different: > > --> a = b = () > --> c = () > --> a is b

Re: Comparing Python enums to Java, was: How much sanity checking is required for function inputs?

2016-04-24 Thread Ethan Furman
On 04/24/2016 08:20 AM, Ian Kelly wrote: On Sun, Apr 24, 2016 at 1:20 AM, Ethan Furman wrote: On 04/23/2016 06:29 PM, Ian Kelly wrote: Python enums are great. Sadly, they're still not quite as awesome as Java enums. What fun things can Java enums do? Everything that Python enums can do,

[issue26800] Don't accept bytearray as filenames part 2

2016-04-24 Thread Guido van Rossum
Guido van Rossum added the comment: OK, I actually agree with you on memoryview and and other types that support the buffer view. I will update PEP 484 to exclude memoryview. But I think bytearray has a special role and purose, and as much as possible it needs to be accepted in places that

[issue26838] sax.xmlreader.InputSource.setCharacterStream() does not work?

2016-04-24 Thread Alan Jenkins
Alan Jenkins added the comment: Looks like this is documented elsewhere and fixed in 3.5. https://fossies.org/diffs/Python/3.4.3_vs_3.5.0/Doc/library/xml.sax.reader.rst-diff.html -- status: open -> closed ___ Python tracker

[issue26838] sax.xmlreader.InputSource.setCharacterStream() does not work?

2016-04-24 Thread Alan Jenkins
New submission from Alan Jenkins: python3-3.4.3-5.fc23-x86_64 So far I spelunked here. Starting from . I experimented with using setCharacterStream() instead of setByteStream() setCharacterStream() is shown in documentation but exercising

[issue26837] assertSequenceEqual() raises BytesWarning when format message

2016-04-24 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: assertSequenceEqual() raises BytesWarning when format failure report. See for example http://buildbot.python.org/all/builders/AMD64%20OpenIndiana%203.x/builds/10575/steps/test/logs/stdio :

Comparing Python enums to Java, was: How much sanity checking is required for function inputs?

2016-04-24 Thread Ian Kelly
On Sun, Apr 24, 2016 at 1:20 AM, Ethan Furman wrote: > On 04/23/2016 06:29 PM, Ian Kelly wrote: > >> Python enums are great. Sadly, they're still not quite as awesome as Java >> enums. > > > What fun things can Java enums do? Everything that Python enums can do, plus: * You

Re: How much sanity checking is required for function inputs?

2016-04-24 Thread Ethan Furman
On 04/23/2016 06:00 PM, Christopher Reimer wrote: Hmm... What do we use Enum for? :) from enum import Enum class Piece(Enum): king = 'one space, any direction' queen = 'many spaces, any direction' bishop = 'many spaces, diagonal' knight = 'two spaces cardinal, one space

[issue26836] Add memfd_create to os module

2016-04-24 Thread Christian Heimes
New submission from Christian Heimes: Add memfd_create() and constants MFD_ALLOW_SEALING, MFD_CLOEXEC to the os module. A glibc wrapper for memfd_create() is not available yet but the interface has been standardized. http://man7.org/linux/man-pages/man2/memfd_create.2.html

[issue26835] Add file-sealing ops to fcntl

2016-04-24 Thread Christian Heimes
New submission from Christian Heimes: The file-sealing ops are useful for memfd_create(). The new syscall and ops are only available on Linux with a recent kernel. http://man7.org/linux/man-pages/man2/fcntl.2.html http://man7.org/linux/man-pages/man2/memfd_create.2.html Code: #include

[issue23277] Cleanup unused and duplicate imports in tests

2016-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is the patch that contains the rest of changes, after resolving conflicts and fixing some errors. I have reviewed and tested these changes and they LGTM. I think it is worth to push them. -- resolution: fixed -> status: closed -> open Added

[issue23277] Cleanup unused and duplicate imports in tests

2016-04-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9d7f2615f7b3 by Serhiy Storchaka in branch 'default': Issue #23277: Remove more unused sys and os imports. https://hg.python.org/cpython/rev/9d7f2615f7b3 New changeset abf3f0dcf2fd by Serhiy Storchaka in branch 'default': Issue #23277: Remove

RE: Remove directory tree without following symlinks

2016-04-24 Thread Albert-Jan Roskam
> From: eryk...@gmail.com > Date: Sat, 23 Apr 2016 15:22:35 -0500 > Subject: Re: Remove directory tree without following symlinks > To: python-list@python.org > > On Sat, Apr 23, 2016 at 4:34 AM, Albert-Jan Roskam > wrote: >> >>> From: eryk...@gmail.com >>> Date: Fri, 22 Apr 2016 13:28:01 -0500

[issue26739] idle: Errno 10035 a non-blocking socket operation could not be completed immediately

2016-04-24 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Caveat emptor: I know nothing of IDLE, and I even suspect it to be dead or dying code. Non the less, it could be patched. I found this in the code: def putmessage(self, message): self.debug("putmessage:%d:" % message[0]) try:

Re: A pickle problem!

2016-04-24 Thread Fabien
On 04/21/2016 11:43 PM, Paulo da Silva wrote: class C(pd.DataFrame): Note also that subclassing pandas is not always encouraged: http://pandas.pydata.org/pandas-docs/stable/internals.html#subclassing-pandas-data-structures Cheers, Fabien --

[issue20572] subprocess.Popen.wait() undocumented "endtime" parameter

2016-04-24 Thread Daryl Luna
Changes by Daryl Luna : -- nosy: +Daryl Luna status: pending -> open Added file: http://bugs.python.org/file42579/downloadfile.htm ___ Python tracker

[issue26739] idle: Errno 10035 a non-blocking socket operation could not be completed immediately

2016-04-24 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Hi there. I don't think this is in relation to issue #9090. That one had to do with the internal mechanisms of doing blocking IO with timeout. this is done internally by using non-blocking sockets and select(), and the backport dealt with some edge

[issue23277] Cleanup unused and duplicate imports in tests

2016-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Note that setUpModule is correctly imported in Lib/tkinter/test/test_tkinter/test_widgets.py. -- nosy: +serhiy.storchaka ___ Python tracker

[issue26814] [WIP] Add a new _PyObject_FastCall() function which avoids the creation of a tuple or dict for arguments

2016-04-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think you can simplify the patch by dropping keyword arguments support from fastcall. Then you can decrease _PyStack_SIZE to 4 (larger size will serve only 1.7% of calls), and may be refactor a code since an array of 4 pointers consumes less C stack than

Re: How much sanity checking is required for function inputs?

2016-04-24 Thread Ethan Furman
On 04/23/2016 06:21 PM, Michael Selik wrote: On Sat, Apr 23, 2016 at 9:01 PM Christopher Reimer wrote: Hmm... What do we use Enum for? :) You can use Enum in certain circumstances to replace int or str constants. It can help avoid mistyping mistakes and might help your IDE give

Re: How much sanity checking is required for function inputs?

2016-04-24 Thread Ethan Furman
On 04/23/2016 06:29 PM, Ian Kelly wrote: Python enums are great. Sadly, they're still not quite as awesome as Java enums. What fun things can Java enums do? -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

[issue26814] [WIP] Add a new _PyObject_FastCall() function which avoids the creation of a tuple or dict for arguments

2016-04-24 Thread STINNER Victor
STINNER Victor added the comment: > Thus I think we need to optimize only cases of calling with small number > (0-3) of positional arguments. My code is optimized to up to 10 positional arguments: with 0..10 arguments, the C stack is used to hold the array of PyObject*. For more arguments, an

  1   2   >