[issue17264] Update Building C and C++ Extensions with distutils documentation

2016-04-09 Thread Berker Peksag
Berker Peksag added the comment: bad92d696866 has already been removed all Python 1.4 and 2.0 references. I fixed a markup error and two broken references. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior versions: +Python 3.5, Python

[issue17264] Update Building C and C++ Extensions with distutils documentation

2016-04-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset ca6f174f5932 by Berker Peksag in branch '3.5': Issue #17264: Fix cross refs and a markup error in extending/building.rst https://hg.python.org/cpython/rev/ca6f174f5932 New changeset 7f7988ea908f by Berker Peksag in branch 'default': Issue #17264:

[issue26718] super.__init__ leaks memory if called multiple times

2016-04-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If super used __new__ instead of __init__, this issue probably wouldn't arise. I'm surprised that super is subclassable. -- nosy: +gvanrossum, serhiy.storchaka ___ Python tracker

Re: Repair??

2016-04-09 Thread Random832
- Original message - From: Amaya McLean To: Random832 Subject: Re: Repair?? Date: Sat, 9 Apr 2016 10:41:52 -0400 How, specifically, are you installing Python? There are many ways, and > we can't guess which you use. > I'm trying to install

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Antoon Pardon
Op 09-04-16 om 16:41 schreef Chris Angelico: > > In this case, you're likely to end up with large branches of your tree > that have the same prefix. (And if you don't, your iterations are all > going to end early anyway, so the comparison is cheap.) A data > structure that takes this into

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Chris Angelico
On Sun, Apr 10, 2016 at 1:24 AM, Antoon Pardon wrote: > Op 09-04-16 om 16:41 schreef Chris Angelico: > >> >> In this case, you're likely to end up with large branches of your tree >> that have the same prefix. (And if you don't, your iterations are all >> going to

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Random832
On Sat, Apr 9, 2016, at 07:49, Ben Finney wrote: > I find that a dubious claim. > > The ‘cmp’ implementation must decide *at least* between three > conditions: less-than, equal-to, greater-than. That is *at least* two > inflection points. Yes, but in a sequence it can decide that at each

[issue26719] More efficient formatting of ints and floats in json

2016-04-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is similar issue with unneeded strings copying: issue26057. -- ___ Python tracker ___

[issue17339] bytes() TypeError message is misleadingly narrow

2016-04-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Martin. Interesting, int.from_bytes() accepts lists (and other iterables): >>> int.from_bytes([1, 2, 3], "little") 197121 Is it intentional? -- ___ Python tracker

[issue26718] super.__init__ leaks memory if called multiple times

2016-04-09 Thread Guido van Rossum
Guido van Rossum added the comment: Any uses of super() beyond the documented idioms are uninteresting, except they should not be usable as crash or DoS vectors. -- ___ Python tracker

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Marko Rauhamaa
Antoon Pardon : > And when I need some personal object as a key, I can avoid the > duplication by using some kind of cmp cache when I implement __lt__ > and family. Yes, that's what you can do in rare, extreme cases where key comparison takes a long time. For

Re: Find the number of robots needed to walk through the rectangular grid

2016-04-09 Thread Ian Kelly
On Sat, Apr 9, 2016 at 8:18 AM, Joe wrote: > How to find the number of robots needed to walk through the rectangular grid > The movement of a robot in the field is divided into successive steps > > In one step a robot can move either horizontally or vertically (in one row or

Re: (Python 3.5) Asyncio and an attempt to run loop.run_until_complete() from within a running loop

2016-04-09 Thread Ian Kelly
On Sat, Apr 9, 2016 at 9:14 AM, Ian Kelly wrote: > On Fri, Apr 8, 2016 at 5:54 PM, Alexander Myodov wrote: > This does mean that the pattern for calling aio_map from outside the > event loop is different from calling it inside the event loop. Your >

Re: QWERTY was not designed to intentionally slow typists down (was: Unicode normalisation [was Re: [beginner] What's wrong?])

2016-04-09 Thread Random832
On Fri, Apr 8, 2016, at 23:28, Steven D'Aprano wrote: > And how did it enable fast typing? By *slowing down the typist*, and thus > having fewer jams. Er, no? The point is that type bars that are closer together collide more easily *at the same actual typing speed* than ones that are further

Re: QWERTY was not designed to intentionally slow typists down (was: Unicode normalisation [was Re: [beginner] What's wrong?])

2016-04-09 Thread Random832
On Fri, Apr 8, 2016, at 23:28, Steven D'Aprano wrote: > This is the power of the "slowing typists down is a myth" meme: same > Wikipedia contributor takes an article which *clearly and obviously* > repeats the conventional narrative that QWERTY was designed to > decrease the number of key presses

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Antoon Pardon
Op 09-04-16 om 17:31 schreef Chris Angelico: > On Sun, Apr 10, 2016 at 1:24 AM, Antoon Pardon > wrote: >> >> So? I need a structure that can easily give me an answer to the >> following: Given key1 and key2 what are the the keys between them >> with their

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-09 Thread Rustom Mody
On Saturday, April 9, 2016 at 7:14:05 PM UTC+5:30, Ben Bacarisse wrote: > The problem with that theory is that 'er/re' (this is e and r in either > order) is the 3rd most common pair in English but have been placed > together. ou and et (in either order) are the 15th and 22nd most common > and

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-09 Thread alister
On Fri, 08 Apr 2016 20:20:02 -0400, Dennis Lee Bieber wrote: > On Fri, 8 Apr 2016 11:04:53 -0700 (PDT), Rustom Mody > declaimed the following: > >>Its reasonably likely that all our keyboards start QWERT... >> Doesn't make it a sane design. >> > It was a sane design

[issue26719] More efficient formatting of ints and floats in json

2016-04-09 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch provide more efficient solution of issue18264. Instead of creating new int or float object and then converting it to string, the patch directly uses functions that does int and float conversion to string. -- components: Extension

[issue16679] Add advice about non-ASCII wsgiref PATH_INFO

2016-04-09 Thread Martin Panter
Changes by Martin Panter : -- title: Wrong URL path decoding -> Add advice about non-ASCII wsgiref PATH_INFO ___ Python tracker ___

[issue21069] test_fileno of test_urllibnet intermittently fails

2016-04-09 Thread Berker Peksag
Berker Peksag added the comment: I saw test_fileno failure again on the Gentoo buildbot: http://buildbot.python.org/all/builders/x86%20Gentoo%20Installed%20with%20X%203.x/builds/459/steps/test/logs/stdio rewrite-fileno.patch looks good to me. -- nosy: +berker.peksag stage: patch

[issue26716] EINTR handling in fcntl

2016-04-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 60ac28b612af by Victor Stinner in branch '3.5': Update fcntl doc: replace IOError with OSError https://hg.python.org/cpython/rev/60ac28b612af -- nosy: +python-dev ___ Python tracker

[issue26716] EINTR handling in fcntl

2016-04-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It looks to me that interrupting fcntl can be used for implementing blocking lock with a timeout. If automatically retry fcntl() on EINTR, this will break such code. -- ___ Python tracker

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Antoon Pardon
Op 08-04-16 om 16:25 schreef Chris Angelico: > On Sat, Apr 9, 2016 at 12:20 AM, Antoon Pardon > wrote: >>> You only need ONE comparison, and the other is presumed to be its >>> opposite. When, in the Python 3 version, would you need to compare >>> twice? >> >> About

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-09 Thread Ben Bacarisse
alister writes: > > the design of qwerty was not to "Slow" the typist bu to ensure that the > hammers for letters commonly used together are spaced widely apart, > reducing the portion of trier travel arc were the could jam. > I and E are actually such a pair which

[issue21069] test_fileno of test_urllibnet intermittently fails

2016-04-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 00240ddce1d0 by Martin Panter in branch '3.5': Issue #21069: Move test_fileno() from test_urllibnet and rewrite it https://hg.python.org/cpython/rev/00240ddce1d0 New changeset 4c19396bd4a0 by Martin Panter in branch 'default': Issue #21069: Merge

Find the number of robots needed to walk through the rectangular grid

2016-04-09 Thread Joe
How to find the number of robots needed to walk through the rectangular grid The movement of a robot in the field is divided into successive steps In one step a robot can move either horizontally or vertically (in one row or in one column of cells) by some number of cells A robot can move in

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Antoon Pardon
Op 09-04-16 om 13:49 schreef Ben Finney: > Antoon Pardon writes: > >> You don't seem to understand. I only do two comparisons and no the >> equality is not necesarrily cheaper. >> >> I am talking about the difference between the following two: >> >> if arg.key <

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Marko Rauhamaa
Antoon Pardon : > Now this probably is not a problem most of the times, but when you > work with tree's this kind of comparison to make a three way decision > happens often and the lower you descend in the tree, the close your > argument will be with the keys of the

[issue26719] More efficient formatting of ints and floats in json

2016-04-09 Thread Guido van Rossum
Guido van Rossum added the comment: Please also backport to 3.5.2... On Saturday, April 9, 2016, Raymond Hettinger wrote: > > Raymond Hettinger added the comment: > > +1 This is a nice improvement. > > -- > > ___ > Python

Re: (Python 3.5) Asyncio and an attempt to run loop.run_until_complete() from within a running loop

2016-04-09 Thread Ian Kelly
On Fri, Apr 8, 2016 at 5:54 PM, Alexander Myodov wrote: > Hello. > > TLDR: how can I use something like loop.run_until_complete(coro), to execute > a coroutine synchronously, while the loop is already running? > > More on this: > > I was trying to create an aio_map(coro,

[issue26609] Wrong request target in test_httpservers.py

2016-04-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0e19f421dc9e by Martin Panter in branch '3.5': Issue #26609: Fix HTTP server tests to request an absolute URL path https://hg.python.org/cpython/rev/0e19f421dc9e New changeset 34ebf79acd78 by Martin Panter in branch 'default': Issue #26609: Merge

Re: past exam paper help!

2016-04-09 Thread Joseph Caulfield
On Saturday, April 9, 2016 at 2:48:16 PM UTC+1, Joseph Caulfield wrote: > how would I model a mug a cylindrical vessel with an open top in python? > thansk :) *as a cylindrical vessel. -- https://mail.python.org/mailman/listinfo/python-list

past exam paper help!

2016-04-09 Thread Joseph Caulfield
how would I model a mug a cylindrical vessel with an open top in python? thansk :) -- https://mail.python.org/mailman/listinfo/python-list

[issue17339] bytes() TypeError message is misleadingly narrow

2016-04-09 Thread Martin Panter
Martin Panter added the comment: I think this patch is okay. I would have suggested “Cannot construct bytes from [. . .]” to avoid the problem with “convert”, but this message is produced in places other than the constructor, e.g. >>> int.from_bytes("str", "little") TypeError: cannot convert

Re: past exam paper help!

2016-04-09 Thread Ian Kelly
On Sat, Apr 9, 2016 at 7:49 AM, Joseph Caulfield wrote: > On Saturday, April 9, 2016 at 2:48:16 PM UTC+1, Joseph Caulfield wrote: >> how would I model a mug a cylindrical vessel with an open top in python? >> thansk :) > > *as a cylindrical vessel. class Vessel:

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-09 Thread Ben Bacarisse
Ben Bacarisse writes: > alister writes: > >> >> the design of qwerty was not to "Slow" the typist bu to ensure that the >> hammers for letters commonly used together are spaced widely apart, >> reducing the portion of trier travel arc were

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Chris Angelico
On Sun, Apr 10, 2016 at 12:25 AM, Antoon Pardon wrote: > Let me give you an artifical example to show what can happen. The keys are all > iterables of equal lengths with integers as elements. > > Then this could be the cmp function: > > def cmp(ob1, ob2): > itr1

[issue26719] More efficient formatting of ints and floats in json

2016-04-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 This is a nice improvement. -- ___ Python tracker ___ ___

[issue23434] RFC6266 support (Content-Disposition for HTTP)

2016-04-09 Thread Piotr Dobrogost
Changes by Piotr Dobrogost : -- nosy: +piotr.dobrogost ___ Python tracker ___

[issue26716] EINTR handling in fcntl

2016-04-09 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka added the comment: > It looks to me that interrupting fcntl can be used for implementing blocking lock with a timeout. If automatically retry fcntl() on EINTR, this will break such code. If the signal handler doesn't raise an exception, the

[issue26722] Fold compare operators on constants (peephole)

2016-04-09 Thread Alexander Marshalov
New submission from Alexander Marshalov: Missed peephole optimization: 1 > 2 -> False 3 < 4 -> True 5 == 6 -> False 6 != 7 -> True 7 >= 8 -> False 8 <= 9 -> True 10 is 11 -> False 12 is not 13 -> True 14 in (15, 16, 17) -> False 18 not in (19, 20,

[issue10289] Document magic methods called by built-in functions

2016-04-09 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue24291] wsgiref.handlers.SimpleHandler truncates large output blobs

2016-04-09 Thread Martin Panter
Martin Panter added the comment: I suspect this bug does not affect Python 2. See my demo script wsgi-partial.py as evidence, which interrupts a 20 MB write with a signal. Jason: If you look at Python 2’s file.write() API , perhaps

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Ben Finney
Antoon Pardon writes: > You don't seem to understand. I only do two comparisons and no the > equality is not necesarrily cheaper. > > I am talking about the difference between the following two: > > if arg.key < node.key: # possible expensive computation >

[issue13410] String formatting bug in interactive mode

2016-04-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The issue for str was fixed in issue15516. The issue for unicode is not fixed yet. -- nosy: +serhiy.storchaka ___ Python tracker

[issue15516] exception-handling bug in PyString_Format

2016-04-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This fixed an issue for str, but not for unicode. See issue13410. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue10289] Document magic methods called by built-in functions

2016-04-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka versions: +Python 3.6 -Python 3.4 ___ Python tracker ___

[issue26720] memoryview from BufferedWriter becomes garbage

2016-04-09 Thread Martin Panter
New submission from Martin Panter: >>> class Raw(RawIOBase): ... def writable(self): return True ... def write(self, b): ... global written ... written = b ... return len(b) ... >>> writer = BufferedWriter(Raw()) >>> writer.write(b"blaua") 5 >>> raw =

[issue26721] Avoid socketserver.StreamRequestHandler.wfile doing partial writes

2016-04-09 Thread Martin Panter
New submission from Martin Panter: This is a follow-on from Issue 24291. Currently, for stream servers (as opposed to datagram servers), the wfile attribute is a raw SocketIO object. This means that wfile.write() is a simple wrapper around socket.send(), and can do partial writes. There is a

[issue17339] bytes() TypeError message is misleadingly narrow

2016-04-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch. -- keywords: +patch nosy: +serhiy.storchaka stage: needs patch -> patch review versions: +Python 3.6 -Python 3.4 Added file: http://bugs.python.org/file42413/bytes_from_object_error_msg.patch ___

[issue24291] wsgiref.handlers.SimpleHandler truncates large output blobs

2016-04-09 Thread Martin Panter
Martin Panter added the comment: I did not write a test case for the test suite. Doing so would probably involve too many non-trivial things, so I thought it wouldn’t be worth it: 1. A background thread or process to run a client in 2. Signal handling to trigger a partial write 3. Some way to

[issue26720] memoryview from BufferedWriter becomes garbage

2016-04-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +benjamin.peterson, pitrou, serhiy.storchaka, stutzbach ___ Python tracker ___

[issue26722] Fold compare operators on constants (peephole)

2016-04-09 Thread SilentGhost
Changes by SilentGhost : -- nosy: +benjamin.peterson, brett.cannon, georg.brandl, haypo, ncoghlan, yselivanov stage: -> patch review ___ Python tracker

[issue26722] Fold compare operators on constants (peephole)

2016-04-09 Thread Demur Rumed
Demur Rumed added the comment: Do you have any numbers on how common constant comparisons are in real code? -- nosy: +Demur Rumed ___ Python tracker ___

conda: Fetching package metadata: SSL verification error: EOF occurred in violation of protocol (_ssl.c:645)

2016-04-09 Thread Hongyi Zhao
Hi all, I use the latest conda, ie, Anaconda3-4.0.0-Linux-x86_64 to install some packages, but always meet the following error: $ conda install conda-build Using Anaconda Cloud api site https://api.anaconda.org Fetching package metadata: SSL verification error: EOF occurred in violation of

[issue24291] wsgiref.handlers.SimpleHandler truncates large output blobs

2016-04-09 Thread Martin Panter
Martin Panter added the comment: wfile-partial.patch tries to avoid partial writes in every relevant wfile.write() call I could find. Usually I do this by building a BufferedWriter around wfile. I propose to apply my patch to 3.5 (if people think it is reasonable). For 3.6 I opened Issue

[issue25339] sys.stdout.errors is set to "surrogateescape"

2016-04-09 Thread STINNER Victor
STINNER Victor added the comment: The patch looks good to me. -- ___ Python tracker ___ ___ Python-bugs-list

[issue25339] sys.stdout.errors is set to "surrogateescape"

2016-04-09 Thread STINNER Victor
STINNER Victor added the comment: Ok, I now understand the issue. Your change looks good to me. I agree that strict error handler is good choice for PYTHONIOENCODING=ascii. -- ___ Python tracker

[issue26722] Fold compare operators on constants (peephole)

2016-04-09 Thread STINNER Victor
STINNER Victor added the comment: > Do you have any numbers on how common constant comparisons are in real code? In my experience, it almost never occur in real application. But it's common when you start with a constant propogation optimization: *

[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-09 Thread Demur Rumed
Demur Rumed added the comment: [12:36] Could I get a code review for wordcode's 4th patchset? http://bugs.python.org/review/26647/#ps16875 ... [13:13] serprex: you'd be better off bumping the issue -- ___ Python tracker

[issue25609] Add a ContextManager ABC and type

2016-04-09 Thread Brett Cannon
Brett Cannon added the comment: The typing changes need to be backported to 3.5 as-is to keep the files in sync. -- status: closed -> open versions: +Python 3.5 ___ Python tracker

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-09 Thread Ben Bacarisse
Rustom Mody writes: > On Saturday, April 9, 2016 at 7:14:05 PM UTC+5:30, Ben Bacarisse wrote: >> The problem with that theory is that 'er/re' (this is e and r in either >> order) is the 3rd most common pair in English but have been placed >> together. ou and et (in either

[issue26723] Add an option to skip _decimal module

2016-04-09 Thread Chi Hsuan Yen
New submission from Chi Hsuan Yen: As said by Stefan Krah in http://bugs.python.org/issue23496#msg236886, Android ports can use pure python decimal module. Of course I can, but _decimal is always built and error messages are spamming. This change allow disabling _decimal from ./configure.

Re: Find the number of robots needed to walk through the rectangular grid

2016-04-09 Thread Joe
On Saturday, 9 April 2016 18:44:20 UTC+2, Ian wrote: > On Sat, Apr 9, 2016 at 8:18 AM, Joe wrote: > > How to find the number of robots needed to walk through the rectangular grid > > The movement of a robot in the field is divided into successive steps > > > > In one step a robot can move either

[issue26723] Add an option to skip _decimal module

2016-04-09 Thread Stefan Krah
Stefan Krah added the comment: I thought you solved the locale problem in #20305. So it still does not build? -- nosy: +skrah ___ Python tracker ___

Re: Find the number of robots needed to walk through the rectangular grid

2016-04-09 Thread Joe
On Saturday, 9 April 2016 21:55:50 UTC+2, Mark Lawrence wrote: > On 09/04/2016 20:41, Joe wrote: > > > > Sorry, I was desperate > > I deleted the post > > > > You didn't. This will be showing in the archives in several places, e.g >

[issue10289] Document magic methods called by built-in functions

2016-04-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Most of the proposed update look reasonable updates and would improve the documentation. That said, please take care to not accidentally document and unintentionally guarantee implementation details rather than language requirements (leaving freedom for

[issue26725] list() destroys map object data

2016-04-09 Thread Ned Deily
Ned Deily added the comment: This is behaving as expected. In Python 3, map() returns an iterator, so the first list(x) exhausts that iterator so that the second list(x) returns an empty list. This is a difference from Python 2 where map() returns a list. See:

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread alister
On Sat, 09 Apr 2016 20:13:15 +0100, Mark Lawrence wrote: > On 09/04/2016 01:43, Ben Finney wrote: >> Dennis Lee Bieber writes: >> >> > Yet another completely irrelevant thread that has nothing to do with > Python. As this is meant to be the main Python mailing list, why

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread Ethan Furman
On 04/09/2016 12:36 PM, Mark Lawrence via Python-list wrote: Very amusing to see that some highly qualified 'moderators' have been so bloody rude on other Python mailing lists in the last days. Do as I say, not as I do? Nope -- you should take that as all of us are human and sometimes our

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread Tim Golden
On 09/04/2016 22:23, Mark Lawrence via Python-list wrote: [... snip ...] Mark, you're ranting. Have a little dignity, please, and back off. TJG -- https://mail.python.org/mailman/listinfo/python-list

[issue26720] memoryview from BufferedWriter becomes garbage

2016-04-09 Thread Martin Panter
Martin Panter added the comment: On further thought, I think releasing the buffer would not be the best long-term solution. I encountered this bug when wrapping custom AuditableBytesIO objects (Lib/test/test_httpservers.py) with BufferedWriter, where the raw object just saves each write()

Re: Python,ping,csv

2016-04-09 Thread Jason Friedman
> for ping in range(1,254): > address = "10.24.59." + str(ping) > res = subprocess.call(['ping', '-c', '3', address]) > if res == 0: > print ("ping to", address, "OK") > elif res == 2: > print ("no response from", address) > else: > print ("ping to",

RE: [E] QWERTY was not designed to intentionally slow typists down (was: Unicode normalisation [was Re: [beginner] What's wrong?])

2016-04-09 Thread Coll-Barth, Michael via Python-list
-Original Message- From: Ben Finney >> This is an often-repeated myth, with citations back as far as the 1970s. >> It is false. >> The design is intended to reduce jamming the print heads together, but the >> goal of this is not to reduce speed, but to enable *fast* typing. >> It

[issue26724] Serialize dict with non-string keys to JSON — unexpected result

2016-04-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think etrepum's comment on Aug 27, 2013 display's sound reasoning: ''' I expect that this error checking feature would be expensive to implement (both in runtime cost and lines of code). I think the most sensible thing to do would be to just mention this

[issue21069] test_fileno of test_urllibnet intermittently fails

2016-04-09 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

[issue26722] Fold compare operators on constants (peephole)

2016-04-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: AFAICT, the cases the OP listed would be rarely found in real code. Victor is correct is saying that we want to limit the scope of the peepholer to the most useful cases. He is also correct in saying that we've long desired constant folding to be moved

Re: REMOVE ME

2016-04-09 Thread Ben Finney
fan nie writes: > [no content] Thank you for sending a message to everyone on the mailing list, with the full correct information on how to check subscription settings and how to unsubscribe. As you are no doubt aware, since you left the message body entirely blank to draw

[issue26722] Fold compare operators on constants (peephole)

2016-04-09 Thread Alexander Marshalov
Alexander Marshalov added the comment: Hi all, this is my first patch to Python. I'm interested in the performance of python code, I even worked on the development of the static optimizer based on modifications of the AST. I had a few ideas for improving peepholer (for example, the expression

[issue25609] Add a ContextManager ABC and type

2016-04-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5c0e332988b2 by Martin Panter in branch 'default': Issue #25609: Double back-ticks to avoid “make check” buildbot failure https://hg.python.org/cpython/rev/5c0e332988b2 -- ___ Python tracker

Re: REMOVE ME

2016-04-09 Thread Chris Angelico
On Sun, Apr 10, 2016 at 1:46 PM, fan nie wrote: > > -- > https://mail.python.org/mailman/listinfo/python-list Sure. I presume you mean something like this: class Thing: things = [] def __init__(self): self.things.append(self) def __del__(self): #

[issue15984] Wrong documentation for PyUnicode_FromObject() and PyUnicode_FromEncodedObject()

2016-04-09 Thread Martin Panter
Martin Panter added the comment: Here is a modified patch that avoids “coercion” and is hopefully more explicit. I also fixed the comment in Include/unicodeobject.h. -- nosy: +martin.panter stage: needs patch -> patch review versions: +Python 3.5, Python 3.6 -Python 3.3, Python 3.4

[issue26725] list() destroys map object data

2016-04-09 Thread Steven Reed
New submission from Steven Reed: Example repro: Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> x=map(bool,[1,0,0,1,1,0]) >>> x >>> list(x) [True, False, False, True,

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread Mark Lawrence via Python-list
On 09/04/2016 21:22, alister wrote: On Sat, 09 Apr 2016 20:13:15 +0100, Mark Lawrence wrote: On 09/04/2016 01:43, Ben Finney wrote: Dennis Lee Bieber writes: Yet another completely irrelevant thread that has nothing to do with Python. As this is meant to be the

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-09 Thread Stephen Hansen
On Sat, Apr 9, 2016, at 12:25 PM, Mark Lawrence via Python-list wrote: > Again, where is the relevance to Python in this discussion, as we're on > the main Python mailing list? Please can the moderators take this stuff > out, it is getting beyond the pale. You need to come to grip with the

[issue26722] Fold compare operators on constants (peephole)

2016-04-09 Thread Nick Coghlan
Nick Coghlan added the comment: Nice work on getting this running, Alexander. However, as Victor and Raymond noted, we're looking to head in a different direction with our bytecode optimisation efforts, which is to better support pluggable AST level optimisations that can make more

Re: QWERTY was not designed to intentionally slow typists down (was: Unicode normalisation [was Re: [beginner] What's wrong?])

2016-04-09 Thread pyotr filipivich
Dennis Lee Bieber on Sat, 09 Apr 2016 14:52:50 -0400 typed in comp.lang.python the following: >On Sat, 09 Apr 2016 11:44:48 -0400, Random832 >declaimed the following: > >>I don't understand where this idea that alternating hands makes you >>slows

REMOVE ME

2016-04-09 Thread fan nie
-- https://mail.python.org/mailman/listinfo/python-list

[issue15984] Wrong documentation for PyUnicode_FromObject() and PyUnicode_FromEncodedObject()

2016-04-09 Thread Martin Panter
Changes by Martin Panter : Removed file: http://bugs.python.org/file42418/from_object_v3.patch ___ Python tracker ___

[issue26720] memoryview from BufferedWriter becomes garbage

2016-04-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Another option is to use the bytes object as internal buffer. If its refcount is == 1 (normal case), it is modified in-place, otherwise (if the reference is saved outside) new bytes object is created. -- ___

Re: Conditionals in Python cli with -m oneliner

2016-04-09 Thread Peter Otten
gvim wrote: > Given that this work in a Python 3 repl: > import re txt = "Some random text" if re.search(r"\b\w{4}\b", txt): txt 'Some random text' > > and this works on the command line, printing all lines in logs.txt: > > $ python3 -m oneliner -ne 'line' logs.txt >

[issue26726] Incomplete Internationalization in Argparse Module

2016-04-09 Thread Grady Martin
New submission from Grady Martin: The attached, teensy-weensy patch passes to gettext() a string which had previously been passed as-is. Relevant mailing list message: http://article.gmane.org/gmane.comp.python.devel/157035 -- files: argparse_i18n.patch keywords: patch messages:

[issue26721] Avoid socketserver.StreamRequestHandler.wfile doing partial writes

2016-04-09 Thread Martin Panter
Martin Panter added the comment: Here is a patch with my proposal. -- keywords: +patch Added file: http://bugs.python.org/file42417/buffered-wfile.patch ___ Python tracker

[issue15984] Wrong documentation for PyUnicode_FromObject() and PyUnicode_FromEncodedObject()

2016-04-09 Thread Martin Panter
Changes by Martin Panter : Added file: http://bugs.python.org/file42419/from_object_v3.patch ___ Python tracker ___

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Paul Rubin
Ben Finney writes: > The ‘cmp’ implementation must decide *at least* between three > conditions... The implementation of ‘__lt__’ and the implementation > of ‘__eq__’ each only need to decide two conditions (true, false). > If you're saying the latter implementation

Conditionals in Python cli with -m oneliner

2016-04-09 Thread gvim
Given that this work in a Python 3 repl: import re txt = "Some random text" if re.search(r"\b\w{4}\b", txt): txt 'Some random text' and this works on the command line, printing all lines in logs.txt: $ python3 -m oneliner -ne 'line' logs.txt . why does this fail: $ python3 -m

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread Mark Lawrence via Python-list
On 09/04/2016 01:43, Ben Finney wrote: Dennis Lee Bieber writes: Yet another completely irrelevant thread that has nothing to do with Python. As this is meant to be the main Python mailing list, why don't the moderators put a stop to such tripe? -- My fellow

Re: Find the number of robots needed to walk through the rectangular grid

2016-04-09 Thread Mark Lawrence via Python-list
On 09/04/2016 18:13, Joe wrote: On Saturday, 9 April 2016 18:44:20 UTC+2, Ian wrote: On Sat, Apr 9, 2016 at 8:18 AM, Joe wrote: How to find the number of robots needed to walk through the rectangular grid The movement of a robot in the field is divided into successive steps In one step a

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread Tim Golden
On 09/04/2016 20:13, Mark Lawrence via Python-list wrote: On 09/04/2016 01:43, Ben Finney wrote: Dennis Lee Bieber writes: Yet another completely irrelevant thread that has nothing to do with Python. As this is meant to be the main Python mailing list, why don't the

  1   2   >