Antoon Pardon wrote:
Maybe I'm going to be pedantic here, but I fear that your code won't
work with matrices. The problem is that multiplication is not
commutative with matrices. This means that matrices have two divisions a right
and a left division. A far as I know the / operator usaly
On 2008-08-01, Terry Reedy [EMAIL PROTECTED] wrote:
Nevertheless, I think this is probably the best example of the
enhanced polymorphism of if x yet. I'm kind of surprised no one
came up with it.)
I think of Python code as 'generic' rather than 'polymorphic'. I am not
sure if that is a
Erik Max Francis wrote:
Antoon Pardon wrote:
[responding to me]
Maybe I'm going to be pedantic here, but I fear that your code won't
work with matrices. The problem is that multiplication is not
commutative with matrices. This means that matrices have two divisions
a right
and a left
On 2008-08-01, Carl Banks [EMAIL PROTECTED] wrote:
On Jul 31, 1:27 pm, Chris Mellon [EMAIL PROTECTED] wrote:
I'm really not sure where you're going with this or what you're trying
to prove. if x is a duck-type test for a boolean value. Obviously if
you know the type and want a more *specific*
Antoon Pardon wrote:
I now have the following question for people who argue that if x
is more polymorphic. I could subclass list, so that instances
of this new sequence would always behave as true, even if they are
empty. I could then rewrite my loop as follows:
while 1:
extra = produce()
On 2008-08-01, Erik Max Francis [EMAIL PROTECTED] wrote:
Antoon Pardon wrote:
I now have the following question for people who argue that if x
is more polymorphic. I could subclass list, so that instances
of this new sequence would always behave as true, even if they are
empty. I could then
Antoon Pardon wrote:
On 2008-08-01, Erik Max Francis [EMAIL PROTECTED] wrote:
Antoon Pardon wrote:
I now have the following question for people who argue that if x
is more polymorphic. I could subclass list, so that instances
of this new sequence would always behave as true, even if they are
Carl Banks wrote:
On Jul 31, 11:44 pm, Carl Banks [EMAIL PROTECTED] wrote:
[snip excellent explanation of why it's hard to for if x to be
extensively polymorphic]
By the way, one thing I forgot to mention is Matt Fitzgibbons' filter
example.
As I said, it's hard to write code that works for
Matthew Fitzgibbons wrote:
'if x' strikes me as better for this case because you might want to
accept a non-empty list (or some other objects) but reject non-empty
lists. 'if x is None' would not work. It still may be susceptible to the
empty iterator problem, depending on what prep_func does.
On 2008-08-01, Matthew Fitzgibbons [EMAIL PROTECTED] wrote:
Antoon Pardon wrote:
On 2008-08-01, Erik Max Francis [EMAIL PROTECTED] wrote:
Antoon Pardon wrote:
I now have the following question for people who argue that if x
is more polymorphic. I could subclass list, so that instances
of
On Aug 1, 8:49 am, Matthew Fitzgibbons [EMAIL PROTECTED] wrote:
Carl Banks wrote:
On Jul 31, 11:44 pm, Carl Banks [EMAIL PROTECTED] wrote:
[snip excellent explanation of why it's hard to for if x to be
extensively polymorphic]
By the way, one thing I forgot to mention is Matt
Nevertheless, I think this is probably the best example of the
enhanced polymorphism of if x yet. I'm kind of surprised no one
came up with it.)
I think of Python code as 'generic' rather than 'polymorphic'. I am not
sure if that is a real difference or not, since I am a bit fuzzy on the
Carl Banks wrote:
On Aug 1, 8:49 am, Matthew Fitzgibbons [EMAIL PROTECTED] wrote:
Carl Banks wrote:
On Jul 31, 11:44 pm, Carl Banks [EMAIL PROTECTED] wrote:
[snip excellent explanation of why it's hard to for if x to be
extensively polymorphic]
By the way, one thing I forgot to mention is Matt
On Aug 1, 3:36 pm, Terry Reedy [EMAIL PROTECTED] wrote:
Nevertheless, I think this is probably the best example of the
enhanced polymorphism of if x yet. I'm kind of surprised no one
came up with it.)
I think of Python code as 'generic' rather than 'polymorphic'. I am not
sure if that
On Aug 1, 4:45 pm, Carl Banks [EMAIL PROTECTED] wrote:
On Aug 1, 3:36 pm, Terry Reedy [EMAIL PROTECTED] wrote:
Nevertheless, I think this is probably the best example of the
enhanced polymorphism of if x yet. I'm kind of surprised no one
came up with it.)
I think of Python code as
On Aug 1, 4:45 pm, Carl Banks [EMAIL PROTECTED] wrote:
On Aug 1, 3:36 pm, Terry Reedy [EMAIL PROTECTED] wrote:
In general, asking code to apply across numeric, container, and other
classes is asking too much. Python code can be generic only within
protocol/interface categories such as
On Jul 30, 10:43 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
Russ P. wrote:
On Jul 30, 9:27 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
You're sure going on about a distinction without a difference for a guy
who childishly likes to call other people names. A reasonable person
would
On Jul 31, 7:08 am, Russ P. [EMAIL PROTECTED] wrote:
On Jul 30, 10:43 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
Russ P. wrote:
On Jul 30, 9:27 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
You're sure going on about a distinction without a difference for a guy
who childishly
On Tue, Jul 29, 2008 at 3:37 AM, Carl Banks [EMAIL PROTECTED] wrote:
On Jul 28, 8:15 pm, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
On Mon, 28 Jul 2008 13:22:37 -0700, Carl Banks wrote:
On Jul 28, 10:00 am, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
Steven D'Aprano wrote:
On Wed, 30 Jul 2008 09:23:05 -0600, Matthew Fitzgibbons wrote:
If you're expecting a list (and only a list)
then your point makes sense. 'if x' can get you into trouble if you
_don't_ want its polymorphism.
if x is hardly unique in that way. If you're expecting a list,
Steven D'Aprano wrote:
On Wed, 30 Jul 2008 09:23:05 -0600, Matthew Fitzgibbons wrote:
If you're expecting a list (and only a list)
then your point makes sense. 'if x' can get you into trouble if you
_don't_ want its polymorphism.
if x is hardly unique in that way. If you're expecting a list,
Matthew Fitzgibbons wrote:
Steven D'Aprano wrote:
On Wed, 30 Jul 2008 09:23:05 -0600, Matthew Fitzgibbons wrote:
If you're expecting a list (and only a list)
then your point makes sense. 'if x' can get you into trouble if you
_don't_ want its polymorphism.
if x is hardly unique in that way.
Steven D'Aprano wrote:
On Wed, 30 Jul 2008 20:55:03 +0100, Matthew Woodcraft wrote:
On the other hand, iterators provide a clear example of problems with
if x: __nonzero__ for iterators (in general) returns True even if they
are 'empty'.
How do you propose telling whether an iterator is
On Thu, 31 Jul 2008 22:01:48 +0100, Matthew Woodcraft wrote:
Steven D'Aprano wrote:
On Wed, 30 Jul 2008 20:55:03 +0100, Matthew Woodcraft wrote:
On the other hand, iterators provide a clear example of problems with
if x: __nonzero__ for iterators (in general) returns True even if
they are
Steven D'Aprano wrote:
On Thu, 31 Jul 2008 22:01:48 +0100, Matthew Woodcraft wrote:
The point is that if you tell people that if x is the standard way to
check for emptiness, and also support a general principle along the
lines of write your function using the interfaces you expect, and call
On Jul 31, 1:27 pm, Chris Mellon [EMAIL PROTECTED] wrote:
I'm really not sure where you're going with this or what you're trying
to prove. if x is a duck-type test for a boolean value. Obviously if
you know the type and want a more *specific* test, then you can use an
explicit one. Any time
On Jul 31, 12:13 am, Ethan Furman [EMAIL PROTECTED] wrote:
Carl Banks wrote:
So I stand by the point I was trying to make: for your average day-to-
day programming, the main benefit of if x is to save keystrokes. It
doesn't help your code become more polymophic in practice. A little
On Jul 30, 10:05 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
Russ P. wrote:
On Jul 30, 1:07 am, Erik Max Francis [EMAIL PROTECTED] wrote:
Russ P. wrote:
Oh, Lordy. I understand perfectly well how boolean tests, __len__, and
__nonzero__ work in Python. It's very basic stuff. You can quit
On Jul 31, 11:44 pm, Carl Banks [EMAIL PROTECTED] wrote:
[snip excellent explanation of why it's hard to for if x to be
extensively polymorphic]
By the way, one thing I forgot to mention is Matt Fitzgibbons' filter
example.
As I said, it's hard to write code that works for both numeric and
Carl Banks wrote:
If you recall, I agreed with his statement. Would you like to claim
that I don't understand the fundamentals of Python?
Since you've invented this connection out of nowhere, not particularly.
I've never said anything about _anyone_ not understanding the
fundamentals of
On Jul 29, 10:33 pm, Carl Banks [EMAIL PROTECTED] wrote:
On Jul 30, 1:15 am, Russ P. [EMAIL PROTECTED] wrote:
Having said that, it would sure be nice to be able to write
if myList is not empty:
instead of
if len(myList) != 0:
I can agree with this.
But I guess that could only work
Carl Banks wrote:
Bull. This is a request, that, if satisfied, would prove that if x
is more polymorphic than a simple explicit test. I posed the question
precisely to see if anyone could come up with a use case that shows
this benefit of if x.
Except you're the only one who's not convinced
Russ P. wrote:
All this discussion about if x has me wondering. I use it all the
time because a fully explicit test just seems redundant. But maybe it
does have some value in terms of readability and type checking. After
all, it is possible to forget whether something is a number or a list.
Carl Banks wrote:
On Jul 30, 1:15 am, Russ P. [EMAIL PROTECTED] wrote:
All this discussion about if x has me wondering. I use it all the
time because a fully explicit test just seems redundant. But maybe it
does have some value in terms of readability and type checking. After
all, it is
Russ P. wrote:
On Jul 29, 10:33 pm, Carl Banks [EMAIL PROTECTED] wrote:
On Jul 30, 1:15 am, Russ P. [EMAIL PROTECTED] wrote:
Having said that, it would sure be nice to be able to write
if myList is not empty:
instead of
if len(myList) != 0:
I can agree with this.
But I guess that could
On Jul 29, 11:09 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
I'm getting this sneaking suspicion that you guys are all putting us on.
As I said in an earlier post, I realize that this would only work if
there were only one copy of empty (as there is only one copy of
None). I don't know off
On Jul 29, 11:16 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
Russ P. wrote:
On Jul 29, 10:33 pm, Carl Banks [EMAIL PROTECTED] wrote:
On Jul 30, 1:15 am, Russ P. [EMAIL PROTECTED] wrote:
Having said that, it would sure be nice to be able to write
if myList is not empty:
instead of
Russ P. wrote:
On Jul 29, 11:09 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
I'm getting this sneaking suspicion that you guys are all putting us on.
As I said in an earlier post, I realize that this would only work if
there were only one copy of empty (as there is only one copy of
None).
Russ P. wrote:
Come to think of it, shouldn't the list type have an isempty method?
Or does it?
Yes. It's written:
if not aList:
...
--
Erik Max Francis [EMAIL PROTECTED] http://www.alcyone.com/max/
San Jose, CA, USA 37 18 N 121 57 W AIM, Y!M erikmaxfrancis
The
On Jul 29, 11:36 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
Russ P. wrote:
On Jul 29, 11:09 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
I'm getting this sneaking suspicion that you guys are all putting us on.
As I said in an earlier post, I realize that this would only work if
On Jul 29, 11:36 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
Russ P. wrote:
Come to think of it, shouldn't the list type have an isempty method?
Or does it?
Yes. It's written:
if not aList:
...
As you know, that is not quite exactly the same thing. An isempty
On Jul 30, 2:06 am, Erik Max Francis [EMAIL PROTECTED] wrote:
Perhaps in the particular use case you're thinking of (numeric types vs.
container types), there aren't any good examples. But who cares?
You don't have to. I am trying to set the record straight on just how
much polymophism if x
On Jul 30, 1:58 am, Russ P. [EMAIL PROTECTED] wrote:
On Jul 29, 10:33 pm, Carl Banks [EMAIL PROTECTED] wrote:
On Jul 30, 1:15 am, Russ P. [EMAIL PROTECTED] wrote:
Having said that, it would sure be nice to be able to write
if myList is not empty:
instead of
if len(myList) != 0:
Am Mittwoch, 30. Juli 2008 08:30:48 schrieb Russ P.:
On Jul 29, 11:09 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
I'm getting this sneaking suspicion that you guys are all putting us on.
As I said in an earlier post, I realize that this would only work if
there were only one copy of empty
On Jul 30, 12:03 am, Heiko Wundram [EMAIL PROTECTED] wrote:
Am Mittwoch, 30. Juli 2008 08:30:48 schrieb Russ P.:
On Jul 29, 11:09 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
I'm getting this sneaking suspicion that you guys are all putting us on.
As I said in an earlier post, I realize
Am Mittwoch, 30. Juli 2008 09:18:48 schrieb Russ P.:
Oh, Lordy. I understand perfectly well how boolean tests, __len__, and
__nonzero__ work in Python. It's very basic stuff. You can quit
patronizing me (and Carl too, I'm sure).
I'll stop repeating what the current state is (which might sound
On Jul 30, 12:49 am, Heiko Wundram [EMAIL PROTECTED] wrote:
Am Mittwoch, 30. Juli 2008 09:18:48 schrieb Russ P.:
Oh, Lordy. I understand perfectly well how boolean tests, __len__, and
__nonzero__ work in Python. It's very basic stuff. You can quit
patronizing me (and Carl too, I'm sure).
Russ P. wrote:
On Jul 29, 11:36 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
Russ P. wrote:
Come to think of it, shouldn't the list type have an isempty method?
Or does it?
Yes. It's written:
if not aList:
...
As you know, that is not quite exactly the same thing. An
Carl Banks wrote:
I mean in general. I wouldn't spell it like that. I would prefer if
empty(x), with an __empty__ method. (And support __nonzero__ aka
__bool__ dropped completely.)
So your argument is purely about style, then. You just wish it were
written differently.
--
Erik Max
Russ P. wrote:
Oh, Lordy. I understand perfectly well how boolean tests, __len__, and
__nonzero__ work in Python. It's very basic stuff. You can quit
patronizing me (and Carl too, I'm sure).
You suggested a syntax for testing non-emptiness (`x is not empty`)
which indicated a profound
Russ P. wrote:
Oh, Lordy. I understand perfectly well how boolean tests, __len__, and
__nonzero__ work in Python. It's very basic stuff. You can quit
patronizing me (and Carl too, I'm sure).
The point that you seem to be missing, or refuse to acknowledge for
some reason, is that if x can be
Le Tuesday 29 July 2008 23:48:31 [EMAIL PROTECTED], vous avez écrit :
Here's a function, print_members. It's just something that takes some
iterable and prints its members in XML. It's special-cased so that an
empty iterable gets an empty tag. (This is a bit of a trivial
example, I admit;
On Jul 30, 5:09 am, Maric Michaud [EMAIL PROTECTED] wrote:
Le Tuesday 29 July 2008 23:48:31 [EMAIL PROTECTED], vous avez écrit :
def print_members(iterable):
if not iterable:
print 'members /'
return
print 'members'
for item in iterable:
print
On Jul 30, 3:53 am, Russ P. [EMAIL PROTECTED] wrote:
Fair enough. I have no dog in this particular fight. I just think it
wouldn't hurt to add an isempty() or isnonempty() method to the
list type, and let people use it if they wish, or continue using if
x if that's what they prefer.
Go right
Le Wednesday 30 July 2008 15:31:28 [EMAIL PROTECTED], vous avez écrit :
class Signal:
[...]
def dc_offset(self, amount):
if amount == 0:
return
self.samples = [sample + amount for sample in self.samples]
This function is also wrong assuming
Carl Banks wrote:
That's not what I was asking for. I was asking for a use case for if
x that can't be replaced by a simple explicit test. Your example
didn't satisfy that.
But I believe my example of an iterator with __bool__ but not with
__len__ does.
--
Carl Banks wrote:
On Jul 30, 1:58 am, Russ P. [EMAIL PROTECTED] wrote:
On Jul 29, 10:33 pm, Carl Banks [EMAIL PROTECTED] wrote:
On Jul 30, 1:15 am, Russ P. [EMAIL PROTECTED] wrote:
Having said that, it would sure be nice to be able to write
if myList is not empty:
instead of
if len(myList)
Russ P. wrote:
On Jul 30, 12:03 am, Heiko Wundram [EMAIL PROTECTED] wrote:
Am Mittwoch, 30. Juli 2008 08:30:48 schrieb Russ P.:
On Jul 29, 11:09 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
I'm getting this sneaking suspicion that you guys are all putting us on.
As I said in an earlier
Carl Banks wrote:
On Jul 29, 6:42 pm, Matthew Fitzgibbons [EMAIL PROTECTED] wrote:
Carl Banks wrote:
Much like in Steven D'Aprano's example, still the only actual code
snippet I've seen, it seems that this can easily be done with a simple
explicit test by having all no-advance filters return
Carl Banks wrote:
On Jul 29, 6:42 pm, Matthew Fitzgibbons [EMAIL PROTECTED] wrote:
I don't have any postable code (it's in a half way state and I haven't
touched it for a while), but I'll see if I can't find the time to bang
something up to give you the gist.
I wouldn't bother at this point.
Terry Reedy [EMAIL PROTECTED] wrote:
Carl Banks wrote:
That's not what I was asking for. I was asking for a use case for if
x that can't be replaced by a simple explicit test. Your example
didn't satisfy that.
But I believe my example of an iterator with __bool__ but not with
__len__
On Jul 30, 1:07 am, Erik Max Francis [EMAIL PROTECTED] wrote:
Russ P. wrote:
Oh, Lordy. I understand perfectly well how boolean tests, __len__, and
__nonzero__ work in Python. It's very basic stuff. You can quit
patronizing me (and Carl too, I'm sure).
You suggested a syntax for testing
On Jul 30, 11:07 am, Terry Reedy [EMAIL PROTECTED] wrote:
Carl Banks wrote:
That's not what I was asking for. I was asking for a use case for if
x that can't be replaced by a simple explicit test. Your example
didn't satisfy that.
But I believe my example of an iterator with __bool__
On Jul 30, 3:56 am, Erik Max Francis [EMAIL PROTECTED] wrote:
Carl Banks wrote:
I mean in general. I wouldn't spell it like that. I would prefer if
empty(x), with an __empty__ method. (And support __nonzero__ aka
__bool__ dropped completely.)
So your argument is purely about style,
On Jul 30, 4:49 am, Ethan Furman [EMAIL PROTECTED] wrote:
Carl Banks wrote:
On Jul 29, 6:42 pm, Matthew Fitzgibbons [EMAIL PROTECTED] wrote:
I don't have any postable code (it's in a half way state and I haven't
touched it for a while), but I'll see if I can't find the time to bang
Russ P. wrote:
On Jul 30, 1:07 am, Erik Max Francis [EMAIL PROTECTED] wrote:
Russ P. wrote:
Oh, Lordy. I understand perfectly well how boolean tests, __len__, and
__nonzero__ work in Python. It's very basic stuff. You can quit
patronizing me (and Carl too, I'm sure).
You suggested a syntax
On Jul 30, 1:50 am, Carl Banks [EMAIL PROTECTED] wrote:
On Jul 30, 1:58 am, Russ P. [EMAIL PROTECTED] wrote:
On Jul 29, 10:33 pm, Carl Banks [EMAIL PROTECTED] wrote:
On Jul 30, 1:15 am, Russ P. [EMAIL PROTECTED] wrote:
Having said that, it would sure be nice to be able to write
On Jul 30, 7:05 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
Russ P. wrote:
On Jul 30, 1:07 am, Erik Max Francis [EMAIL PROTECTED] wrote:
Russ P. wrote:
Oh, Lordy. I understand perfectly well how boolean tests, __len__, and
__nonzero__ work in Python. It's very basic stuff. You can quit
On Wed, 30 Jul 2008 09:23:05 -0600, Matthew Fitzgibbons wrote:
If you're expecting a list (and only a list)
then your point makes sense. 'if x' can get you into trouble if you
_don't_ want its polymorphism.
if x is hardly unique in that way. If you're expecting a list, and only
a list,
On Wed, 30 Jul 2008 20:55:03 +0100, Matthew Woodcraft wrote:
On the other hand, iterators provide a clear example of problems with
if x: __nonzero__ for iterators (in general) returns True even if they
are 'empty'.
How do you propose telling whether an iterator is empty?
That's a generic
Russ P. wrote:
The reason I wrote that it would be nice to be able to write
if x is not empty:
is that it reads naturally. It was not an actual proposal, and the
fact that you took it as such was *your* mistake.
...
Now read carefully: I DID NOT CLAIM THAT THIS IS THE WAY TO DO IT!
Carl Banks wrote:
On Jul 30, 4:49 am, Ethan Furman [EMAIL PROTECTED] wrote:
Even for those that did realize, and in fact hoped that that is what you
were attempting to accomplish,
I was not attempting to accomplish what you think I was.
I was looking for it, but I didn't want to see it. I
On Jul 30, 8:03 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
Russ P. wrote:
The reason I wrote that it would be nice to be able to write
if x is not empty:
is that it reads naturally. It was not an actual proposal, and the
fact that you took it as such was *your* mistake.
...
On Thu, 31 Jul 2008 02:41:08 +, Steven D'Aprano wrote:
On Wed, 30 Jul 2008 09:23:05 -0600, Matthew Fitzgibbons wrote:
...
Although, if my function is expecting a list, my preference is to do:
if not isinstance(x, list):
raise SomeMeaningfulException()
# do stuff with the list
I
Russ P. wrote:
[snippers]
The reason I wrote that it would be nice to be able to write
if x is not empty:
is that it reads naturally.
[and more snippers]
Reads naturally? For whom? Readability counts does not mean make it
sound like english as much as possible. There are good reasons
On Jul 30, 8:24 pm, Russ P. [EMAIL PROTECTED] wrote:
On Jul 30, 8:03 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
Russ P. wrote:
The reason I wrote that it would be nice to be able to write
if x is not empty:
is that it reads naturally. It was not an actual proposal, and the
Russ P. wrote:
I don't know if you can read minds, but you seem to have a lot of
trouble reading words.
Can you read it would be nice to be able to write ...? Can you
understand what it means? Can you understand that it does *not* mean,
one *should* be able to write ...?
You're sure going on
Ethan Furman wrote:
If that's really what you want, go join Dave Parker and Flaming Thunder.
Best recommendation in this thread to date :)
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 30, 9:27 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
Russ P. wrote:
I don't know if you can read minds, but you seem to have a lot of
trouble reading words.
Can you read it would be nice to be able to write ...? Can you
understand what it means? Can you understand that it does
Russ P. wrote:
On Jul 30, 9:27 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
You're sure going on about a distinction without a difference for a guy
who childishly likes to call other people names. A reasonable person
would have long ago moved on instead of blaming others for not
immediately
On Jul 28, 8:15 pm, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
On Mon, 28 Jul 2008 13:22:37 -0700, Carl Banks wrote:
On Jul 28, 10:00 am, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
Cutting to the crux of the discussion...
On Sun, 27 Jul 2008 23:45:26
Am Dienstag, 29. Juli 2008 10:37:45 schrieb Carl Banks:
You keep bringing up this notion of more complex with no benefit,
which I'm simply not interested in talking about that at this time,
and I won't respond to any of your points. I am seeking the answer to
one question: whether if x can
On Tue, 29 Jul 2008 01:37:45 -0700, Carl Banks wrote:
On Jul 28, 8:15 pm, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
On Mon, 28 Jul 2008 13:22:37 -0700, Carl Banks wrote:
On Jul 28, 10:00 am, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
Cutting to the crux
Steven D'Aprano wrote:
On Tue, 29 Jul 2008 00:23:02 +, Steven D'Aprano wrote:
Dude. Dude. Just... learn some Python before you embarrass yourself
further.
I'm sorry Anders, that was a needlessly harsh thing for me to say. I
apologize for the unpleasant tone.
Still, __nonzero__ is a
Am Dienstag, 29. Juli 2008 11:15:05 schrieb Heiko Wundram:
I can't dig up a simple example from code I wrote quickly...
Just to get back to that: an example I found where if x (the generic
__nonzero__() test) will work to test for emptiness/non-emptiness of a
container, whereas if len(x) 0
Heiko Wundram wrote:
Am Dienstag, 29. Juli 2008 11:15:05 schrieb Heiko Wundram:
I can't dig up a simple example from code I wrote quickly...
Just to get back to that: an example I found where if x (the generic
__nonzero__() test) will work to test for emptiness/non-emptiness of a
container,
Carl Banks wrote:
On Jul 28, 8:15 pm, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
On Mon, 28 Jul 2008 13:22:37 -0700, Carl Banks wrote:
On Jul 28, 10:00 am, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
Cutting to the crux of the discussion...
On Sun, 27 Jul 2008
On Jul 29, 5:27 am, Steven D'Aprano
[EMAIL PROTECTED] wrote:
On Tue, 29 Jul 2008 01:37:45 -0700, Carl Banks wrote:
I am looking for one that can't.
If you are writing code that needs to do the right thing with arbitrary
types, then your so-called simple explicit tests simply can't work.
I
On Jul 29, 5:15 am, Heiko Wundram [EMAIL PROTECTED] wrote:
I can't dig up a simple example from code I wrote quickly, but because of the
fact that explicit comparisons always hamper polymorphism
I'm not going to take your word for it. Do you have code that
demonstrates how if x improves
On Jul 29, 11:12 am, Matthew Fitzgibbons [EMAIL PROTECTED] wrote:
Carl Banks wrote:
On Jul 28, 8:15 pm, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
On Mon, 28 Jul 2008 13:22:37 -0700, Carl Banks wrote:
On Jul 28, 10:00 am, Steven D'Aprano [EMAIL PROTECTED]
On Jul 29, 1:30 pm, Carl Banks [EMAIL PROTECTED] wrote:
On Jul 29, 5:15 am, Heiko Wundram [EMAIL PROTECTED] wrote:
I can't dig up a simple example from code I wrote quickly, but because of
the
fact that explicit comparisons always hamper polymorphism
I'm not going to take your word for
On Jul 29, 5:27 am, Steven D'Aprano
[EMAIL PROTECTED] wrote:
On Tue, 29 Jul 2008 01:37:45 -0700, Carl Banks wrote:
I would accept as evidence something that satisfies my criteria, which
your example did not: it could have easily (and more robustly) been
written with a simple explicit test.
Carl Banks wrote:
On Jul 29, 1:30 pm, Carl Banks [EMAIL PROTECTED] wrote:
On Jul 29, 5:15 am, Heiko Wundram [EMAIL PROTECTED] wrote:
I can't dig up a simple example from code I wrote quickly, but because of the
fact that explicit comparisons always hamper polymorphism
I'm not going to take
Steven D'Aprano [EMAIL PROTECTED] wrote:
if x is completely type agnostic. You can pass an object of any type to
it, and it will work. (Excluding objects with buggy methods, naturally.)
There are many circumstances where if a parameter is None I'd rather
get an exception than have the code
Am 29.07.2008, 18:30 Uhr, schrieb Carl Banks [EMAIL PROTECTED]:
On Jul 29, 5:15 am, Heiko Wundram [EMAIL PROTECTED] wrote:
I can't dig up a simple example from code I wrote quickly, but because
of the
fact that explicit comparisons always hamper polymorphism
I'm not going to take your word
On Jul 29, 4:08 pm, Erik Max Francis [EMAIL PROTECTED] wrote:
Carl Banks wrote:
On Jul 29, 1:30 pm, Carl Banks [EMAIL PROTECTED] wrote:
On Jul 29, 5:15 am, Heiko Wundram [EMAIL PROTECTED] wrote:
I can't dig up a simple example from code I wrote quickly, but because of
the
fact that
On Jul 29, 3:43 pm, Heiko Wundram [EMAIL PROTECTED] wrote:
Am 29.07.2008, 18:30 Uhr, schrieb Carl Banks [EMAIL PROTECTED]:
On Jul 29, 5:15 am, Heiko Wundram [EMAIL PROTECTED] wrote:
I can't dig up a simple example from code I wrote quickly, but because
of the
fact that explicit
On Jul 29, 1:30 pm, Carl Banks [EMAIL PROTECTED] wrote:
On Jul 29, 5:15 am, Heiko Wundram [EMAIL PROTECTED] wrote:
I can't dig up a simple example from code I wrote quickly, but because of
the
fact that explicit comparisons always hamper polymorphism
I'm not going to take your word for
Also, just a couple of points:
Am 29.07.2008, 22:27 Uhr, schrieb Carl Banks [EMAIL PROTECTED]:
1. Any container type that returns a length that isn't exactly the
number of elements in it is broken.
I agree, but how do you ever expect to return an infinite element count?
The direction I took
Carl Banks wrote:
On Jul 29, 11:12 am, Matthew Fitzgibbons [EMAIL PROTECTED] wrote:
Carl Banks wrote:
On Jul 28, 8:15 pm, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
On Mon, 28 Jul 2008 13:22:37 -0700, Carl Banks wrote:
On Jul 28, 10:00 am, Steven D'Aprano [EMAIL PROTECTED]
1 - 100 of 120 matches
Mail list logo