Inheriting the @ sign from Ruby

Erik Max Francis max at alcyone.com
Tue Dec 12 11:56:51 EST 2000


Roy Katz wrote:

> I disagree; Like I mentioned above, this would enforce
> standardization.

It wouldn't enforce anything, since programmers wouldn't be mandated to
use it.  Programmers who didn't want to use the @ shorthand could still
call the `self' argument anything they liked.

To be honest I have seen very little variation in the name of the `self'
argument, and I doubt it would be a huge problem to decipher someone
else's code who used, say, `this' instead.  I don't think it's a serious
problem.  I don't think the @ shorthand is a bad idea, but at the same
time all it would do is make Python code more obfuscated, start
arguments about whether it was a good idea in the first place, and
unless mandated (which would _really_ piss people off) wouldn't
accomplish the goals it was set out to do.

> Python's language is not crystal-clear, imho.

I don't see how making it more obfuscated would help that.

> If we're so tough on
> perl for having a kludgy interface, why do we have {} for
> defining dictionaries instead of [ key:value ]?

Makes perfect sense, actually -- you have tuples, lists, and
dictionaries, and each are set off with different punctuation to make it
clear to everyone (including the interpreter) what type they are.

> (I've been programming in Python for three years now
> and I understand only that passing an int or float is call-by-value,
> otherwise it is call-by-reference.  At the risk of naivete, I would
> like a simple & referencing operator so that I can explicitly,
> finally, have control over this.)

This is actually something I wish had been done explicitly as well; this
is one of the only areas of Python that I found truly irregular and
strange.  It would have been nice to either have pass-by-value be the
default and have an explicit operator for referencing, or vice versa
(doesn't matter to me which one, as long as it's consistent;
pass-by-value as the default makes a little more sense).  Alas, it is a
little too late for that.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ If I had another face, do you think I'd wear this one?
\__/ Abraham Lincoln
    Official Omega page / http://www.alcyone.com/max/projects/omega/
 The official distribution page for the popular Roguelike, Omega.



More information about the Python-list mailing list