Re: [Python-Dev] cpython (2.7): note Ellipsis syntax

2011-07-31 Thread Nick Coghlan
On Sun, Jul 31, 2011 at 4:28 PM, Georg Brandl  wrote:
> (Also, there must have been some reason to make "..." available everywhere
> for Python 3.)

Not really - it just let us ditch some special casing in the
compilation toolchain that *restricted* it to being used in subscripts
(i.e. we were looking at the question from the "is there a good
rationale for keeping this arbitrary restriction?" angle).

Functionality wise, you could already write 'Ellipsis' everywhere you
would otherwise have written '...' and you still have to write ':' as
'slice(None)' outside the context of a subscript operation.

Although, as Raymond notes, it can make a nice substitute for 'pass'
as a placeholder statement, and can also be used as a placeholder
expression.

Cheers,
Nick.

-- 
Nick Coghlan   |   [email protected]   |   Brisbane, Australia
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython: Issue #11651: Improve Makefile test targets.

2011-07-31 Thread Nick Coghlan
On Sun, Jul 31, 2011 at 9:09 AM, nadeem.vawda
 wrote:
> http://hg.python.org/cpython/rev/b76684d62a8d
> changeset:   71645:b76684d62a8d
> user:        Nadeem Vawda 
> date:        Sun Jul 31 01:09:04 2011 +0200
> summary:
>  Issue #11651: Improve Makefile test targets.
>
> - Use -j0 option by default
> - Remove duplicate test run in "make test" and "make testuniversal"

That seems very questionable - the rationale for running the test
suite twice by default to ensure PYC generation is working correctly
still holds.

Cheers,
Nick.

-- 
Nick Coghlan   |   [email protected]   |   Brisbane, Australia
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython: Issue #11651: Improve Makefile test targets.

2011-07-31 Thread Nadeem Vawda
On Sun, Jul 31, 2011 at 10:26 AM, Nick Coghlan  wrote:
> On Sun, Jul 31, 2011 at 9:09 AM, nadeem.vawda
>  wrote:
>> - Remove duplicate test run in "make test" and "make testuniversal"
>
> That seems very questionable - the rationale for running the test
> suite twice by default to ensure PYC generation is working correctly
> still holds.

The consensus on the tracker was that it isn't worth doubling the time taken to
run "make test" to check for a class of bug that seems to be relatively rare.
For changes that touch anything as far-reaching as .pyc generation, you should
be using "make testall" anyway (and that does still use two passes).

Cheers,
Nadeem
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython: Issue #11651: Improve Makefile test targets.

2011-07-31 Thread Barry Warsaw
On Jul 31, 2011, at 06:26 PM, Nick Coghlan wrote:

>That seems very questionable - the rationale for running the test
>suite twice by default to ensure PYC generation is working correctly
>still holds.

Agreed.  I'd at least like to have seen discussion on python-dev instead of
just in the tracker.  FWIW, I wasn't even aware of this issue.

-Barry


signature.asc
Description: PGP signature
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython: Issue #11651: Improve Makefile test targets.

2011-07-31 Thread Barry Warsaw
On Jul 31, 2011, at 06:55 AM, Barry Warsaw wrote:

>On Jul 31, 2011, at 06:26 PM, Nick Coghlan wrote:
>
>>That seems very questionable - the rationale for running the test
>>suite twice by default to ensure PYC generation is working correctly
>>still holds.
>
>Agreed.  I'd at least like to have seen discussion on python-dev instead of
>just in the tracker.  FWIW, I wasn't even aware of this issue.

Er, nm.  I need coffee.

-B


signature.asc
Description: PGP signature
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] cpython (2.7): note Ellipsis syntax

2011-07-31 Thread Antoine Pitrou
On Sat, 30 Jul 2011 23:47:36 -0700
Raymond Hettinger  wrote:
> > 
> > (Also, there must have been some reason to make "..." available everywhere
> > for Python 3.)
> > 
> 
> It's really nice for stub functions:
> 
> def foo(x):
> ...

Using a docstring looks a lot less hackish (and it encourages you to
write a doc!):

def foo(x):
"""Some stub function."""




___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] cpython: Issue #11651: Improve Makefile test targets.

2011-07-31 Thread Antoine Pitrou
On Sun, 31 Jul 2011 18:26:42 +1000
Nick Coghlan  wrote:

> On Sun, Jul 31, 2011 at 9:09 AM, nadeem.vawda
>  wrote:
> > http://hg.python.org/cpython/rev/b76684d62a8d
> > changeset:   71645:b76684d62a8d
> > user:        Nadeem Vawda 
> > date:        Sun Jul 31 01:09:04 2011 +0200
> > summary:
> >  Issue #11651: Improve Makefile test targets.
> >
> > - Use -j0 option by default
> > - Remove duplicate test run in "make test" and "make testuniversal"
> 
> That seems very questionable - the rationale for running the test
> suite twice by default to ensure PYC generation is working correctly
> still holds.

But nobody did it anyway, even the buildbots.

Regards

Antoine.


___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython: Fix closes Issue11281 - smtplib.STMP gets source_address parameter, which adds

2011-07-31 Thread Michael Foord
On 31 Jul 2011, at 02:26, Senthil Kumaran wrote:
> On Sat, Jul 30, 2011 at 11:11:08PM +0300, Ezio Melotti wrote:
>>> -.. class:: SMTP(host='', port=0, local_hostname=None[, timeout])
>>> +.. class:: SMTP(host='', port=0, local_hostname=None[, timeout], 
>>> source_address=None)
>> 
>> The "[, timeout]" now looks weird there, and it would be better to
>> convert it to ", timeout=..." to match the other args.
>> However I don't know what the value should be, since the real value
>> is socket._GLOBAL_DEFAULT_TIMEOUT (i.e. object()) and I don't think
>> it's a good idea to expose that.  Maybe "None" can be used instead?
> 
> I found that [, timeout] bit odd too. But is not mentioning that as
> timeout=None when it is timeout=socket._GLOBAL_DEFAULT_TIME
> technically inaccurate?
> 

It does mean that users will expect to be able to call with an explicit 
timeout=None and get the default behaviour. Just use the numeric value of the 
global timeout perhaps?

MIchael Foord

> FWIW, I see similar style (...,[,timeout], kw=val) adopted elsewhere
> in the library docs too.  urllib, httplib, nntplib etc. Though it does
> not look okay, it is better than giving inaccurate information.
> 
> While ftplib and poplib, has them as timeout=None, while they default
> to socket._GLOBAL_DEFAULT_TIMEOUT object.
> 
> If we decide upon something, it can be made consistent. So, the
> question is, when the timeout argument refers to
> socket._GLOBAL_DEFAULT_TIME, how should we write the docs.
> 
> 1. def somesocketmethod(arg1,arg2, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, 
> ...)
> 
> - I don't see anything is wrong with this.
> 
> 2. def somesocketmethod(arg1,arg2, timeout=None, ...)
> 
> - And explain that it actually points to a socket default timeout
> object, which is odd and can lead to user errors.
> 
> 3. def somesocketmethod(arg1,arg2[,timeout], kwarg=value)
> 
> - That's how it is currently explained at some places. If this style
>  is okay, we can change the places were it refers to None  to be
>  above.
> 
> Thanks for your review comments, I have address the remaining ones.




--
http://www.voidspace.org.uk/


May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing 
http://www.sqlite.org/different.html






___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython: Fix closes Issue11281 - smtplib.STMP gets source_address parameter, which adds

2011-07-31 Thread Antoine Pitrou
On Sun, 31 Jul 2011 17:17:00 +0100
Michael Foord  wrote:
> > I found that [, timeout] bit odd too. But is not mentioning that as
> > timeout=None when it is timeout=socket._GLOBAL_DEFAULT_TIME
> > technically inaccurate?
> > 
> 
> It does mean that users will expect to be able to call with an explicit 
> timeout=None and get the default behaviour. Just use the numeric value of the 
> global timeout perhaps?

The global timeout is controllable at runtime through
socket.setdefaulttimeout(). That's the whole point of using an opaque
sentinel.

Regards

Antoine.


___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] urllib bug in Python 3.2.1?

2011-07-31 Thread MRAB

Someone over at StackOverflow has a problem with urlopen in Python 3.2.1:


http://stackoverflow.com/questions/6892573/problem-with-urlopen/6892843#6892843

This is the code:

from urllib.request import urlopen
f = 
urlopen('http://online.wsj.com/mdc/public/page/2_3020-tips.html?mod=topnav_2_3000')

page = f.read()
f.close()

With Python 3.1 and Python 3.2.1 it works OK, but with Python 3.2.1 the
read returns an empty string (I checked it myself).
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] urllib bug in Python 3.2.1?

2011-07-31 Thread Ned Deily
In article <[email protected]>,
 MRAB  wrote:
> Someone over at StackOverflow has a problem with urlopen in Python 3.2.1:
> 
>  
> http://stackoverflow.com/questions/6892573/problem-with-urlopen/6892843#689284
> 3
> 
> This is the code:
> 
>  from urllib.request import urlopen
>  f = 
> urlopen('http://online.wsj.com/mdc/public/page/2_3020-tips.html?mod=topnav_2_3
> 000')
>  page = f.read()
>  f.close()
> 
> With Python 3.1 and Python 3.2.1 it works OK, but with Python 3.2.1 the
> read returns an empty string (I checked it myself).

http://bugs.python.org/issue12576

-- 
 Ned Deily,
 [email protected]

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com