[Python-ideas] Reducing colon uses to increase readability

Andre Roberge andre.roberge at gmail.com
Tue Jul 1 00:00:14 CEST 2008

On Mon, Jun 30, 2008 at 6:34 PM, Leif Walsh <leif.walsh at gmail.com> wrote:
> On Sun, Jun 29, 2008 at 6:41 PM, Andre Roberge <andre.roberge at gmail.com> wrote:
>> I would argue that, in these last three examples, there might be better choices.
>> (some of these choices have been inspired by reading
>> http://www.resolversystems.com/documentation/index.php/Differences_Between_Resolver_One%27s_Formula_Language_and_Python_Expressions)
> Are you suggesting this because you work with both languages?  This
> e-mail seems a bit self-serving, because of the inclusion of someone's
> in-house language spec.
Nope, never used it.  I try, whenever I can, to always give credit to
the relevant source when I mention something that may appear to be an
original idea - hence the above reference.
> That said, I'm not sure 'arrows' are even the right approach for
> slices.  Slices should be thought of as ranges, which usually lend
> themselves to ellipses.  I remember (loosely, from a long time ago)
> Ruby having '..' and '...' as exclusive and inclusive ranges, and I
> really liked that.
>>  I have seen other alternatives for simple slices suggested in the past such as
>> [a..b] and [a...b] which would be the equivalent of [a->b] and [a=>b];
>> however, the extra "." might sometimes be difficult to read, whereas
>> the difference between "->" and "=>" is much easier to see.
> You're right.  This is one of the reasons I hate Ruby.  Yet another
> reason to ignore your suggestion for slices :-).
Hmm... this is one of the reason you really like it (see above) and
hate it too! ;-)

Sorry, I couldn't resist ;-)


> --
> Cheers,
> Leif

More information about the Python-ideas mailing list