Re: [Python-Dev] Why not support user defined operator overloading ?

2013-09-29 Thread Ned Batchelder
On 9/29/13 9:02 PM, 张佩佩 wrote: On 2013/9/30 8:53 Greg Ewing wrote: It does need to know the operator's precedence and associativity, though, which means either declaring it somewhere, or having some kind of fixed rule I suggest all user defined operator are at lowest priority. Peipei, this is

Re: [Python-Dev] cpython (merge 3.3 -> default): merge from 3.3

2013-09-29 Thread Senthil Kumaran
On Wed, Sep 11, 2013 at 11:14 PM, Antoine Pitrou wrote: > On Thu, 12 Sep 2013 07:57:25 +0200 (CEST) > senthil.kumaran wrote: >> >> +<<< local >> Optional argument random is a 0-argument function returning a >> random float in [0.0, 1.0); if it is the default None, the >>

Re: [Python-Dev] Why not support user defined operator overloading ?

2013-09-29 Thread Eli Bendersky
Can you guys please move this discussion to python-ideas? python-dev is the wrong mailing list. Eli On Sun, Sep 29, 2013 at 6:02 PM, 张佩佩 wrote: > On 2013/9/30 8:53 Greg Ewing wrote: > > It does need to know the operator's precedence and > >associativity, though, which means either declaring >

Re: [Python-Dev] [Python-checkins] cpython (merge 3.3 -> default): Fix http.server's request handling case on trailing '/'.

2013-09-29 Thread Senthil Kumaran
On Fri, Sep 13, 2013 at 7:49 AM, Eric V. Smith wrote: >> Patch contributed by Vajrasky Kok. Addresses Issue #17324 > >> +trailing_slash = True if path.rstrip().endswith('/') else False > > Wouldn't this be better just as: > trailing_slash = path.rstrip().endswith('/') I noticed

Re: [Python-Dev] Why not support user defined operator overloading ?

2013-09-29 Thread 张佩佩
On 2013/9/30 8:53 Greg Ewing wrote: > It does need to know the operator's precedence and >associativity, though, which means either declaring >it somewhere, or having some kind of fixed rule I suggest all user defined operator are at lowest priority. Regards peipei ___

[Python-Dev] Completed: Google Summer of Code 2013 IDLE Unit Testing and Improvements

2013-09-29 Thread Todd V. Rovito
In April 2013 we challenged students to not spend their summer idle around the swimming pool but rather spend their time on IDLE and make a difference. IDLE is Python’s Integrated Development Environment (IDE) that is shipped with each Python release (http://en.wikipedia.org/wiki/IDLE_(Python))

Re: [Python-Dev] Getting Tulip (PEP 3156) into the 3.4 stdlib, marked provisional, named asyncio

2013-09-29 Thread Guido van Rossum
On Sun, Sep 29, 2013 at 10:16 AM, Antoine Pitrou wrote: > On Sun, 29 Sep 2013 09:54:39 -0700 Guido van Rossum > wrote: > > So, with the naming settled (asyncio it is), and lots of other things > still > > to do, I need a BDFL for PEP 3156. Any volunteers? If no-one volunteered > > I'll have to ac

Re: [Python-Dev] Getting Tulip (PEP 3156) into the 3.4 stdlib, marked provisional, named asyncio

2013-09-29 Thread Guido van Rossum
On Sun, Sep 29, 2013 at 5:40 PM, Eric V. Smith wrote: > On 9/27/2013 9:14 PM, Brett Cannon wrote: > > > I don't see any issue with redirecting the discussion. python-tulip@ is > > acting like a SIG for the module, so no real precedent beyond it not > > being hosted as a mail.python.org

Re: [Python-Dev] Why not support user defined operator overloading ?

2013-09-29 Thread Greg Ewing
Steven D'Aprano wrote: there is no need to define new syntax at runtime. The parser doesn't need to know the operator's action until runtime It does need to know the operator's precedence and associativity, though, which means either declaring it somewhere, or having some kind of fixed rule.

Re: [Python-Dev] Getting Tulip (PEP 3156) into the 3.4 stdlib, marked provisional, named asyncio

2013-09-29 Thread Eric V. Smith
On 9/27/2013 9:14 PM, Brett Cannon wrote: > I don't see any issue with redirecting the discussion. python-tulip@ is > acting like a SIG for the module, so no real precedent beyond it not > being hosted as a mail.python.org list. I'm sure I'm in the minority, but I'd like

Re: [Python-Dev] Why not support user defined operator overloading ?

2013-09-29 Thread 张佩佩
Hello: I agree with Steven D'Aprano. Here is an example: class A(object): def __init__(self, value): self.value = value def add(self, other): return self.value + other.value __magic_method__ = {'+':add} a1 = A(1) a2 = A(2) We only n

[Python-Dev] [RELEASED] Python 3.4.0a3

2013-09-29 Thread Larry Hastings
On behalf of the Python development team, I'm pleased to announce the third alpha release of Python 3.4. This is a preview release, and its use is not recommended for production settings. Python 3.4 includes a range of improvements of the 3.x series, including hundreds of small improvements and

Re: [Python-Dev] Getting Tulip (PEP 3156) into the 3.4 stdlib, marked provisional, named asyncio

2013-09-29 Thread Larry Hastings
On 09/27/2013 11:33 PM, Guido van Rossum wrote: I've been looking at my progress with Tulip and the 3.4 release schedule (PEP 429) and it looks like I will have to do some kind of sprint to get it into the release in time for beta 1, which is planned for Nov 24. Ideally I'd get it into alpha 4,

Re: [Python-Dev] Why not support user defined operator overloading ?

2013-09-29 Thread Steven D'Aprano
On Sun, Sep 29, 2013 at 03:35:27PM -0400, Ned Batchelder wrote: > It isn't just a matter of a more complex parser: where would the parser > get the information about these new operators? The obvious first answer > is that they would be defined as part of classes, but that means the > operator

Re: [Python-Dev] 2.6.9rc1

2013-09-29 Thread Jyrki Pulliainen
On Sun, Sep 29, 2013 at 8:11 PM, Barry Warsaw wrote: > Just a quick reminder that I intend to cut 2.6.9rc1 tomorrow. > > Here are the open issues still on my list: > > - 16040 - nntplib: unlimited readline() from connection > > This one is waiting for a patch, but TBH if it doesn't make it into

Re: [Python-Dev] Why not support user defined operator overloading ?

2013-09-29 Thread Ned Batchelder
On 9/29/13 11:06 AM, Xavier Morel wrote: This is more of a python-ideas subject. And one of the reasons likely is that it would require significantly reworking the grammar to handle a kind of user-defined opname (similar to name, but for operator tokens), with user-defined priority and associati

[Python-Dev] 2.6.9rc1

2013-09-29 Thread Barry Warsaw
Just a quick reminder that I intend to cut 2.6.9rc1 tomorrow. Here are the open issues still on my list: - 16040 - nntplib: unlimited readline() from connection This one is waiting for a patch, but TBH if it doesn't make it into 2.6.9 I won't care too much. I also don't mind reviewing and a

Re: [Python-Dev] Getting Tulip (PEP 3156) into the 3.4 stdlib, marked provisional, named asyncio

2013-09-29 Thread Antoine Pitrou
On Sun, 29 Sep 2013 09:54:39 -0700 Guido van Rossum wrote: > So, with the naming settled (asyncio it is), and lots of other things still > to do, I need a BDFL for PEP 3156. Any volunteers? If no-one volunteered > I'll have to accept my own PEP at some point, but I don't really *want* to > do that

[Python-Dev] Why not support user defined operator overloading ?

2013-09-29 Thread Stephen J. Turnbull
张佩佩 writes: > If we can overloading these operators, why we can't overloading > other operators? (like .* often used in matrix, U in set > operation) AIUI, it's considered unpythonic. Operators are considered to be part of the *syntax* of Python, unlike Haskell, where infix syntax can be use

Re: [Python-Dev] Getting Tulip (PEP 3156) into the 3.4 stdlib, marked provisional, named asyncio

2013-09-29 Thread Guido van Rossum
So, with the naming settled (asyncio it is), and lots of other things still to do, I need a BDFL for PEP 3156. Any volunteers? If no-one volunteered I'll have to accept my own PEP at some point, but I don't really *want* to do that. -- --Guido van Rossum (python.org/~guido) __

Re: [Python-Dev] Why not support user defined operator overloading ?

2013-09-29 Thread Steven D'Aprano
On Sun, Sep 29, 2013 at 08:51:37PM +0800, 张佩佩 wrote: > Hello: > As far as I know, there is not a language support user defined operator > overloading. > Python3 can overloading belowed operators. [...] > (Do I miss something ?) Yes, many. http://docs.python.org/3/reference/datamodel.html#s

Re: [Python-Dev] Why not support user defined operator overloading ?

2013-09-29 Thread Xavier Morel
On 2013-09-29, at 14:51 , 张佩佩 wrote: > Hello: > As far as I know, there is not a language support user defined operator > overloading. > Python3 can overloading belowed operators. > - negated > + unchanged > > - minus > + add > * multiplication > / division > //

[Python-Dev] Why not support user defined operator overloading ?

2013-09-29 Thread 张佩佩
Hello: As far as I know, there is not a language support user defined operator overloading. Python3 can overloading belowed operators. - negated + unchanged - minus + add * multiplication / division // true division % remainder ** power