Idea: Python Shorthand (was Re: Why a class when there will only be one instance?

Ville Vainio ville at spammers.com
Thu May 27 11:05:43 EDT 2004


>>>>> "Josh" == Josh Gilbert <jgilbert+comp.lang.python at uvm.edu> writes:


    Josh> Now that's a great idea! Not the sigils stuff, I switched
    Josh> from Perl to Python for a reason, I was putting sigils in my
    Josh> English, C, and so on.

I agree - the $ @ stuff was a (bad) joke, as I said elsewhere.

    Josh> There are two paths, have the IDE convert each line to
    Josh> Python when you hit '\n' or as a batch. The first method
    Josh> would allow it in Python shells.

Live conversion would probably bring less surprises.

    Josh> This is a very good idea. I wonder how hard it will be. 

At least it doesn't *seem* difficult. It might even be easy enough to
do with regexps!

Some syntax brainstorming again:

d f x,y,z=12:  ->   def f(x,y,z=12):    (, is one keystroke just like space)

  d f x,y:     ->   def f(self,x,y):    (d with indent, add self)

p x; r x;      ->   print x; return x


a.b 1,2 ; a..b ; .a;  ->   a.b(1,2); a.b ; self.a;  

Sounds like a potentially fun emacs project, and the style of
programming that could be appreci8ed by TXT MSG gener8n :-).

-- 
Ville Vainio   http://tinyurl.com/2prnb



More information about the Python-list mailing list