Re: [Python-Dev] [Python-checkins] cpython: Issue #1172711: Add 'long long' support to the array module.

2011-09-21 Thread Stefan Krah
Ezio Melotti  wrote:
>> +@unittest.skipIf(not have_long_long, 'need long long support')
>
> I think this would read better with skipUnless and s/have/has/:
>
> @unittest.skipUnless(HAS_LONG_LONG, 'need long long support')

skipUnless() is perhaps a bit cleaner, but have_long_long is pretty
established elsewhere (for example in pyport.h).


Stefan Krah


___
Python-Dev mailing list
Python-Dev@python.org
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 #1172711: Add 'long long' support to the array module.

2011-09-21 Thread Georg Brandl
Am 21.09.2011 15:25, schrieb Ezio Melotti:

>> @@ -1205,6 +1214,18 @@
>>   minitemsize = 4
>>   tests.append(UnsignedLongTest)
>>
>> +@unittest.skipIf(not have_long_long, 'need long long support')
> 
> I think this would read better with skipUnless and s/have/has/:
> 
> @unittest.skipUnless(HAS_LONG_LONG, 'need long long support')

I don't think so. "skip if not" reads pretty well for me, while I
always have to think twice about "unless" -- may be a non-native-
speaker thing.

Georg

___
Python-Dev mailing list
Python-Dev@python.org
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 #1172711: Add 'long long' support to the array module.

2011-09-21 Thread Benjamin Peterson
2011/9/21 Georg Brandl :
> Am 21.09.2011 15:25, schrieb Ezio Melotti:
>
>>> @@ -1205,6 +1214,18 @@
>>>       minitemsize = 4
>>>   tests.append(UnsignedLongTest)
>>>
>>> +@unittest.skipIf(not have_long_long, 'need long long support')
>>
>> I think this would read better with skipUnless and s/have/has/:
>>
>> @unittest.skipUnless(HAS_LONG_LONG, 'need long long support')
>
> I don't think so. "skip if not" reads pretty well for me, while I
> always have to think twice about "unless" -- may be a non-native-
> speaker thing.

You might also not program in Ruby enough. :)

-- 
Regards,
Benjamin
___
Python-Dev mailing list
Python-Dev@python.org
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 #1172711: Add 'long long' support to the array module.

2011-09-21 Thread Meador Inge
On Wed, Sep 21, 2011 at 11:02 AM, Stefan Krah  wrote:

> Ezio Melotti  wrote:
>>> +@unittest.skipIf(not have_long_long, 'need long long support')
>>
>> I think this would read better with skipUnless and s/have/has/:
>>
>> @unittest.skipUnless(HAS_LONG_LONG, 'need long long support')
>
> skipUnless() is perhaps a bit cleaner, but have_long_long is pretty
> established elsewhere (for example in pyport.h).

I agree with Stefan on the have_long_long part.  This is what is used
in the array module
code, struct, ctypes, etc ... (via pyport.h as Stefan mentioned).  As
for the unless/if,
I am OK with the 'if'.  'unless' always causes a double-take for me.
Personal preference I guess.

-- Meador
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Packaging in Python 2 anyone ?

2011-09-21 Thread Éric Araujo
Hi,

I caught Tarek on IRC and forced him to answer my questions.  Here are
the latest news:

- I have cleaned up and synchronized the distutils2 codebase with
packaging in 3.3.  All features and bugs are now identical.  The test
suite runs with Python 2.4 to 2.7; there are three or four test failures
(linux, with threads, UCS4, not shared).  Please clone, build (we
backported hashlib for 2.4), test and file bugs!  We’ll make an alpha4
as soon as all tests pass.

- I have started work in a named branch to provide distutils2 for Python
3.1 and 3.2.  Patches will flow between packaging, distutils2 and
distutils2-py3.  I’ll start a discussion on catalog-sig to improve
support of parallel releases of 2.x and 3.x-compatible projects.

- The docs in the d2 repo will be removed; people will go to
docs.python.org and mentally convert packaging to distutils2.  I’ll
update the PyPI page.

Cheers
___
Python-Dev mailing list
Python-Dev@python.org
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 #1172711: Add 'long long' support to the array module.

2011-09-21 Thread Stephen J. Turnbull
Georg Brandl writes:

 > I don't think so. "skip if not" reads pretty well for me, while I
 > always have to think twice about "unless" -- may be a non-native-
 > speaker thing.

FWIW, speaking as one native speaker, I'm not sure about that.  "do ...
if not condition" doesn't bother me, whether I think of the condition
as an exception or as the normal state of affairs.  I find "do ...
unless condition" to be quite awkward if the condition is a normal state.

___
Python-Dev mailing list
Python-Dev@python.org
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 #1172711: Add 'long long' support to the array module.

2011-09-21 Thread Michael Foord

On 21/09/2011 18:02, Stephen J. Turnbull wrote:

Georg Brandl writes:

  >  I don't think so. "skip if not" reads pretty well for me, while I
  >  always have to think twice about "unless" -- may be a non-native-
  >  speaker thing.

FWIW, speaking as one native speaker, I'm not sure about that.  "do ...
if not condition" doesn't bother me, whether I think of the condition
as an exception or as the normal state of affairs.  I find "do ...
unless condition" to be quite awkward if the condition is a normal state.


I'm not a big fan of skipUnless, but there you go. I find "skip if not" 
readable too and always have to "work out" what skipUnless means. It's 
probably just that "if" and "if not" are such Python idioms and "unless" 
isn't.


Michael


___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/fuzzyman%40voidspace.org.uk




--
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
Python-Dev@python.org
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 #1172711: Add 'long long' support to the array module.

2011-09-21 Thread Ezio Melotti

On 21/09/2011 21.08, Michael Foord wrote:

On 21/09/2011 18:02, Stephen J. Turnbull wrote:

Georg Brandl writes:

>  I don't think so. "skip if not" reads pretty well for me, while I
>  always have to think twice about "unless" -- may be a non-native-
>  speaker thing.

FWIW, speaking as one native speaker, I'm not sure about that.  "do ...
if not condition" doesn't bother me, whether I think of the condition
as an exception or as the normal state of affairs.  I find "do ...
unless condition" to be quite awkward if the condition is a normal 
state.


I'm not a big fan of skipUnless, but there you go. I find "skip if 
not" readable too and always have to "work out" what skipUnless means. 
It's probably just that "if" and "if not" are such Python idioms and 
"unless" isn't.


I don't find it too readable in other contexts (e.g. failUnless), but I 
probably got used to skipUnless with the idiom:

try:
import foo
except ImportError:
foo = None

@skipUnless(foo, 'requires foo')
...

FWIW in Lib/test/support.py we have a "skip_unless_symlink", but the 
other two skipUnless have more readable names: "requires_zlib" and 
"requires_IEEE_754".  In Lib/test/ "skipUnless" is used about 250 times, 
"skipIf" about 100.


Best Regards,
Ezio Melotti



Michael




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