Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Programming IT Technology

Python 2.2 Released 19

742Evergreen writes: "Another Christmas present for the developers: Python 2.2 has been released! A 'What's new' can be found here. Python 2.2 can be found here. Documentation is here."
This discussion has been archived. No new comments can be posted.

Python 2.2 Released

Comments Filter:
  • Normally I'd be excited that Python had a new release with lots of new features... but no longer. Ruby [ruby-lang.org] has stolen my heart.
  • i'm looking forward to experimenting with generators and yield

    i already love python in functional programming mode

    well do Guido & the guys

    Meryy Chrismarse
    • > i already love python in functional programming mode

      It'd sure be nice if Python had useful lambdas, though.

      Peace,
      (jfb)
      • What's wrong with them? Honest question, never had a too close look at them.

        However, Python + the "functional" module were one of the reasons for
        me to try O'Caml, which makes a very nice complement where speed
        matters more (also, type checking and generally more "strictness" are
        a Good Thing sometimes).
      • > What's wrong with them?

        From the Python documentation:

        "[lambda forms] are syntactically restricted to a single expression."

        At least the language is lexically scoped now, which makes things slightly less difficult.

        Peace,
        (jfb)
      • It'd sure be nice if Python had useful lambdas, though.

        Python 2.2 has actually useful lambdas, they are created with the Python construct "def".

  • MMMMM........ Unification of built-in types and classes. You can now inherit ints and lists and dicts etc as classes.
  • If you like Python you will love ruby. Its syntax is imho much nicer and ruby is true OO. There are many technical reasons to like it, but the really great thing is how it is really easy to express yourself in. Unfortunately Ruby is not really as popular outside Japan as it deserves. Check out the pragmatic programmers book and give it a whirl.

    Pragmatic Ruby [pragmaticprogrammer.com]
    • Rudy's on my "Languages to learn" list

      there comes a point when you have to say "This one is for me, now to spend a long time mastering it" because you never explore all of the corners.

      I learn new techniques with every project in every lamguage I write in.

      I've nailed myself to python and php for my current phase (and I've got no choice but to keep up with javascript).

      Anyway I have a ruby question seeing as I don't want to spend the time to find out.

      can you do something like this :

      %class Foo :
      5 bar = "";
      % def __init__ (self, bar) :
      % self.bar = bar
      % def setbar (self, hoge) :
      % self.bar = hoge
      % return self
      % def getbar(self) :
      % return self.bar
      %
      %f = Foo("fred")
      %print f.setbar("shiela").getbar()
      shiela

      my point being that the . separated parts are evaluated left to right

      javascript has a similar approach

      sadly php doesn't and it's a source of frustration

      is ruby like that?
  • I'm really pleased to see that they have expanded and tidied up Python's approach to classes and inheritance.

    Although its not C++ or Perl (or perhaps because it's not) Python has always struck me as a very wonderful language, being very compact syntax-wise yet having a core containing some of the most powerful features of other languages e.g. OO and lambda functions. It's also got a very solid set of standard modules.

    The indenting stuff still throws me, sometimes, though ;)

    • You know for me the indenting wasn't that big of a deal. I rather like it. The part I have the hardest time with is that you declare variables by assigning them and they don't have types because they are all just reference variables. I guess I'm just too stuck on int x and class y from more strongly typed languages. It seems to me that its too easy to make a mistake when your projects get large. For smaller stuff its great. I whipped out a script that parsed my apache log and created a few include files to display the number of code red hits I'd received in a matter of minutes. Now would I want to write an entire application in python? Probably not.
      • It seems to me that its too easy to make a mistake when your projects get large.

        Let it go, man. Go ahead and make the mistake. Run your program. It will show you a stack frame dump and you'll have the problem fixed in 15 seconds. Life's too short obsess over parameter types.

        Python, Perl, Ruby, etc. have huge library collections that are easier to use and understand than most of those from strongly typed languages. Lack of strong typing is not holding them back. (You won't find many unchecked buffers, either.)

      • Well, Python is not a dynamic-typed language like PHP, and variables are actually quite strictly typed. However, just as you have mentioned, the references are not typed so that you end up with quite a lot of assert(type(foo) == types.IntType) in the code. That definitely bites when you need to integrate Python with some strong typed language, like passing stuff into CORBA or C extensions.

        But I disagree that Python is not suitable for large projects. In fact, I found it has good package/module structure (like Module-2/Pascal), and IMHO is easier to manage than header files in C/C++. In my current job, I'll say 75% of our financial planning software product is coded in Python.

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...