Hi everyone
Well, python 3.0 came out just about a week and a bit ago and i though, now people have had a chance to download it and play around with it a bit, what do you think of it? Is it better? What's the best new feature? Stuff like that. Personally i love the new print function, its great to finally see something like that in python.

Recommended Answers

All 17 Replies

I think python 3.0 will clean up the code with a better support for strings (unicode) and the print function. I like the context management protocol (the with statement). I think there is a lot to explore with this. Also class decorators look appealing :)

Yeah, i have never actually had a look at decorators that much but from what i have seen it looks pretty good. I was having a look at the new with statement. Im having a bit of trouble getting my head around it, and also why we need it.

Here is an example use

import os
class Wd(object):
    def __enter__(self, directory):
        self.old = os.getcwd()
        os.chdir(directory)
        return directory
    def __exit__(self):
        os.chdir(self.old)

with Wd("/usr/bin") as wd:
    doSomeFileStuff()

I wouldn't say we need this statement, but it fills a gap: the only tree-like structure at syntax level in python was the class structure (you could have a class C included in a class B included in a class A). The with statement allows the python interpreter to use this tree like structure which you can write in the code. There are many ways to use this.

So is this the equivalent of:

import os
class Wd(object):
    def __enter__(self, directory):
        self.old = os.getcwd()
        os.chdir(directory)
        return directory
    def __exit__(self):
        os.chdir(self.old)

wd = Wd('/usr/bin')
if wd:
    dofilestuff()

Or am i completley missing the point of this whole thing?

I have not used python 3k because I'm still learning under 2.5
Anyway I will be excite for those already are playing with it to tell me what is new and what is better about 3k, which excite them Like what Gribouillis said

I dislike 3. They broke backward compatibility.

However, it is much cleaner and more modern

I heard something about a tool that they were making that you could put your python code into and it would convert it into something that could be used in python 3.0. Is that true? Is there such a tool that can do that, cause i agree with bennet. Its a pain not being able to run programs.

Another problem is that i havent found out how to work wxPython with it yet, there is no wxPython for python 3.0 yet so its all up in the air for the moment. Oh well, ill give it a few months for things to catch up.

Take a stare at:
C:\Python30\Tools\Scripts\2to3.py
and use something like:
2to3 -w example.py

Missing Modules in Python 3.0 will defame it. If developers will develop the modules for Python 3, it will boost it with already said modernism and others stuffs like sneekula thing. Who will go for 3k and miss those valuable modules like wxpython, and many other non standard modules??

Yeah i kinda think they need some big reason for people to change to python 3.0 and i dont think they have that, i mean apart from the new print, input and with things that are in python 3.0 nothing THAT major seems to have changed, i mean some of the unpacking of variables in functions and the like have changed but in the end. Is any of this going to mean that you Want to change to python 3.0.

Personally i will be staying with python 2.5 until i find there is a sufficient reason to change, that would be a new wxPython module that is good for python 3.0 as well as some other modules such as pyGame and the like. But in the end, i really cant see why people will change apart from the fact that that is the future of python. Am i being ignorant here? I dont know. But thats just me.

+1 Paul
Porting available modules to P3k and may be adding New ones are the only reasons to move to P3k. No those modules, I will stay with 2.5. Anyway I hope Devs will dive in, hope so

The problem is that a lot of those modules you are talking about are freeware and as such a labor of love! Love is just a little slower than greed!

Talking about labor of love, here is one beginning Python tutorial that has already been rewritten for Python30:
http://www.swaroopch.com/notes/Python_en:Table_of_Contents

mmm.. True. Hopefully it will not take that long for things to come out though. Once that has happened then i will gladly jump on the python 3.0 bandwagon. Still, well done to the guy who made that tutorial.
Thats quite an acheivement for only a short time.. maybe he wrote it a bit before and just knew when he needed from the PEPs.

By the way Ene, have you added that link to the begginging python sticky? Its sure to be useful so we dont keep getting asked why print "hello world" is not working.

Yeah, Swaroop C.H, Mark Pilgrim and Bruce Eckel have done great work for Python programmers. I love their books (A byte of Python, Dive into Python and Think Python respectively)

Especially for the countries where getting Python Books is a nightmare

The problem is that a lot of those modules you are talking about are freeware and as such a labor of love! Love is just a little slower than greed!

Talking about labor of love, here is one beginning Python tutorial that has already been rewritten for Python30:
http://www.swaroopch.com/notes/Python_en:Table_of_Contents

Ihave already in my Stock, ready for when I will dive in Python 3k

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.