inclusive-lower-bound, exclusive-upper-bound (was Re: Range Operation pre-PEP)

Darren New dnew at san.rr.com
Tue May 15 13:11:47 EDT 2001


Quinn Dunkan wrote:
> Do methods that take an index and a value use the order 'index, value', or
> 'value, index'?  Standard eiffel is 'value, index', but standard python is
> 'index, value'.  I prefer python, but can't articulate why.

I think the reason it's done this way in Eiffel is that the value is
always necessary during an assignment, but the index isn't. For example,
push() and append() need a value, array assignment needs a value and an
integer index, dictionary assignment needs a value and a hashable index,
etc. So the first argument is always the same thing, namely the value.

Much the same way that "item" always means the "current value", whether
that be the queue's front, the stack's top, or the iterator's current
iterant.

This is one of the features of the EiffelBase libraries I find is very
well done, once you get used to it just a little bit. Very easy to
remember orthogonality.

-- 
Darren New / Senior MTS & Free Radical / Invisible Worlds Inc.
       San Diego, CA, USA (PST).  Cryptokeys on demand.
     This is top-quality raw fish, the Rolls-Rice of Sushi!



More information about the Python-list mailing list