the death of lecter

Michal Wallace sabren at
Mon Sep 11 17:56:11 CEST 2000

Hey all,

When I fisrt started reading this newsgroup, I listened to a lot of
newbie complaints about python, and I started thinking about
implementing an "evil" version of python, implemented as a
preprocessor calld Lecter that included things that real python didn't
(and shouldn't!), like curly braces to delimit blocks..

I pretty much lost interest in the project, and today, for other
reasons, decided to turn lecter into a literate programming tool
for python.

More on that soon, BUT FIRST! I took another look at the old source,
which contains comments of some of the other oft-requested things. I
thought I'd post them here in case anyone wanted to turn them into
PEPs. Some of these really are great ideas (most of them aren't mine

   * easy class access:
         class.x = 1  # translates to: self.__class__.x = 1

     # this adds no keywords, but it makes a really common OOP
     # concept much more accessible to python programmers!
     # I really think this is a good idea and worth doing.

   * immediate if:
         print 'x is', x > 0 ? 'positive' : 'negative'

     # I still wish we had a ?: operator..
     # It would be great for lambdas!

   * design by contract (require/ensure/implies)
     # I still think this would be a good idea!
     # maybe instead of keywords, they ought to be in
     # a contract module? 
     # part of the idea is that the contract could be
     # inherited though.
     # I was going to implement these as blocks that
     # would be converted to assert statements, eg:
     # def f(x):
     #     require:
     #        x = 1

   * assignment operators ( +=, -=, /=, *= )
     # looks like the python team beat me to this one! :)

   * foreach someSequence: print this
     # where "this" is a keyword... I think this is dumb now,
     # but the idea was to have a perl-like anonymous variable

   * switch statement:
         switch x:
         case 1:
         case 2:
         case in (3,5):

     # no comment on this one. might be nice, probably not be worth it.

   * extended 'try' syntax:
             print 'do something'
             print 'catch errors'
             print 'clean up' # not allowed in real Python

      # not sure why you'd want to do this, but the fact that you
      # can't seems kind of sad.. :)

   maybe someday:
   * /regexp/  and  x =~ /regexp/

     # ick! :)


- Michal

More information about the Python-list mailing list