Re: [Python-Dev] cpython: Issue #1172711: Add 'long long' support to the array module.
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
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
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.
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.u...
-- 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
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
participants (5)
-
Benjamin Peterson
-
Ezio Melotti
-
Georg Brandl
-
Michael Foord
-
Stephen J. Turnbull