Posted by Kevin D Smith @ 9:58 am on October 28th 2007
Now that I’m living in Oklahoma I thought it might be fun to try to organize a Python User Group. My friend Blaine has been running a dynamic language user group for a while now in Omaha, NE and it sounds like a lot of fun. I thought about doing something similar, but pretty much everyone that contacted here in Norman was only interested in Python. That’s fine with me since Python is my language of choice (although I do enjoy a bit of Javascript from time to time). Anyway, I met up with some people at the National Weather Center who had an interest, and it looks like it’s a go! We’ve set up a web site and we’re working on getting our very own python.org mailing list. So if you live in the central Oklahoma area and are interested in Python at all, keep an eye on our web site for meeting details.
Posted by Kevin D Smith @ 8:44 pm on September 12th 2007
Bruce Eckel made some comments about the upcoming Python 3K (or is it Python 2.9)? While I respect the work that Bruce does and think he is very intelligent, I think I have to agree more with Guido van Rossum’s retort. Yes, the issues that Bruce brings up would be nice to solve. However, as Guido says these are mostly library issues not core issues, and more aptly
It’s open source. What are you waiting for?!
As far as the complaint about self, I realize that this is a religious war and has no clear answer. I do completely agree with Brandon Corfman’s comment about the confusing message TypeError: printString() takes exactly 1 argument (2 given) where one of the arguments is always self. Putting self as the first argument of a method has bothered me about Python since I started using it; however, I do not agree that Python user’s shouldn’t have to use self. when referring to an instance variable. I think Bruce is just plain wrong when he says that “parroting ‘explicit is better than implicit’ is a misuse of that maxim.”This is exactly the kind of thing that maxim is good for. There is no question in anyone’s mind where that variable is coming from when it has self. prefixed to it.
I also prefer things like self. to Ruby’s @, because self at least has a chance of being interpreted correctly without having to look up its meaning. Using an arbitrary character such as @ has no chance of correct interpretation without reading the manual. This is the main reason that I like Python: the syntax is consistent. Okay, it’s not as consistent as Lisp, but it’s pretty consistent. This is also the reason that I hate Python’s decorator syntax, but that’s a discussion for another day.
I think it’s pretty clear that Python 3K isn’t going to solve everyone’s problems and make everyone happy, but it is definitely a step in the right direction.
Posted by Kevin D Smith @ 1:28 am on June 20th 2007
Guido van Rossum posted an update on Python 3000, the next big Python release that is due out in alpha form by the end of the year. What’s interesting about this release is that it is throwing backwards compatibility to the wind. It will definitely be fascinating to see how that turns out.
Overall, I’m pretty excited about this new release. The Python crew is trying to do away with a lot of cruft that has been building up over the years. One of the biggest changes is in printing and formatting. There will no longer be a print statement. Printing message will now be done with print() function. The % string formatting character will also be removed. The most interesting part though is the new formatting strings. They are no longer in the form of “%s” or “%(name)s”. In fact, they look more like a page templating language now with ways to reference attributes, mappings, and sequences.
One thing I’m looking forward to is unicode everywhere. Working on plasTeX has shown me just how vigilant you have to be in programming to keep all of your strings in unicode form. This should make things easier.
Posted by Kevin D Smith @ 3:26 am on March 22nd 2007
I’ve been working through Dave Thomas’ CodeKata for the past few weeks. I get to about one or two a week. I just finished number six which has been the most fun so far. Dave’s told about his solution in Ruby that was 25 lines and took 1.5s on his 1GHz machine. Since I’m more of a Python fan than a Ruby fan, I thought I’d take a shot at his numbers. Here is my 7 line solution.
words = {}
for word in open('wordlist.txt'):
key = ''.join(sorted(list(word.strip().lower())))
words.setdefault(key, []).append(word.strip())
for v in sorted(words.values()):
if len(v) > 1:
print ' '.join(v)
This could be shortened to 5 lines, but isn’t quite as readable.
words = {}
for word in open('wordlist.txt'):
words.setdefault(''.join(sorted(list(word.strip().lower()))), []).append(word.strip())
for v in [x for x in sorted(words.values()) if len(x) > 1]:
print ' '.join(v)
On my 1.83GHz MacBook, this took 0.56s.
Posted by Kevin D Smith @ 3:36 am on March 2nd 2007
While I didn’t get to go to PyCon this year, I read Guido van Rossum’s impressions. It’s quite apparent that the use of Python in One Laptop Per Child project is going to be driving the development of Python in the following months. One paragraph on Guido’s blog that really excites me is shown below.
The software is far from finished. An early version of the GUI and window manager are available, and a few small demo applications: chat, video, two games, and a web browser, and that’s about it! The plan is to write all applications in Python (except for the web browser), and a “view source” button should show the Python source for the currently running application. In the tradition of Smalltalk (Alan Kay is on the OLPC board, and has endorsed the project’s use of Python) the user should be able to edit any part of a “live” aplication and see the effects of the change immediately in the application’s behavior. (A versioned document store will make it possible to roll back disastrous changes.) This is where Krstic wants my help: he hopes I can work magic and implement this feature for Python. I got started right away during the conference, with a reimplementation of python’s reload() function that can patch classes and functions in place. Even this small component still has a long way to go; a checkpoint of the work in progress is checked into subversion as part of the Py3k standard library. That’s not where the rest of my OLPC work will show up; they use GIT for source control, so I will get to learn that.
While I think the changes to Python in the past couple of years have been a bit esoteric (and a bit disheartening), having the ability to update live code would make me as happy as a peach orchard hog! It might even be the tipping point to get Blaine, my friendly neighborhood Smalltalk apologist, to start using Python.
Posted by Kevin D Smith @ 7:10 am on December 8th 2006
After working on a few glitches for a plasTeX user this week, plasTeX is now being used for the documentation of the itools package for Python. Hopefully, this exposure will help out with plasTeX’s adoption for other packages and eventually the documentation at python.org itself.
Posted by Kevin D Smith @ 9:05 am on December 3rd 2006
I submitted a paper to PyCon 2007 this year about my open source framework for processing LaTeX documents, plasTeX. Unfortunately, the reviewers thought that it was too specialized and esoteric. While it is fairly specialized, I don’t see it as being esoteric. Especially since the official way to write Python documentation is in LaTeX. I was hoping to increase interest in plasTeX so that it might some day replace latex2html (a Perl program) as the markup generator for Python documentation. This would eliminate installing Perl as a pre-requisite to writing documentation for Python.
I guess I’m not too worried about it at the moment. plasTeX is still very young and needs testing before it can be used in production environments. By PyCon 2008, it should be ready for action!
Posted by Kevin D Smith @ 9:37 pm on March 29th 2005
Last week was PyCon 2005 at Washington DC. I was fortunate enough to have my workplace foot the bill for my trip. This was the first conference of this type that I’ve been to, so I probably didn’t get as much out of it as I would have liked to. I did however meet Guido van Rossum, Python’s creator. He seems like a decent enough guy.
I would have to say that my favorite parts of the conference were the lightning talks and volunteering at the registration desk. The lightning talks were like “open mike night.” People went did a five minute presentation on little projects that they were working on. For the most part, these things were fairly useless, but very cool. Like a multiple concurrent user Python editor/interpreter. Volunteering at the registration desk was nice because you got to meet more people than you would just going to the talks. I really think that giving a talk would probably be the best way to enjoy PyCon. Hopefully, next year, if my manager is feeling generous again, I’ll get my chance.