| Subcribe via RSS

Jython 2.2: Released. Jython is dead, Long Live Jython!

August 23rd, 2007 | | Posted in Programming, Python

Per Frank Wierzbicki jython2.2 has been released - this is great news for those of us in hybrid shops (or those who just really like Jython). The new version includes:

  • new-style classes
  • Java List integration
  • PEP 302 implementation
  • iterators
  • generators
  • __future__ division
  • support for running on modern JVMs
  • a new installer
  • ssl and non-blocking support for socket

While you're checking out a Dynamic language running in the JVM - maybe you should also look at the JVM-Languages google group (on which I lurk) - there's some awesome, and crazy stuff going on there between the Jython/JRuby/Groovy/etc folks. Alot of brain juice flows.

The T in IT: Mr. T endorses Hitachi Gear

August 22nd, 2007 | | Posted in Comedy, Personal, Storage

Before I give the links to the videos, I want to give the typical disclaimer:

Disclaimer: The opinions expressed here are my personal opinions, views, discussions, etc. Content published here is not read or approved in advance by HDS, my wife or anyone else for that matter and does not - in any way - reflect the views and opinions, positions/etc of my employer. This is my personal, largely python-related blog. Not my employers.

That being said: A few months ago, I discovered (much by accident) that HDS (Hitachi Data Systems) has started a viral marketing compaign involving Mr. T - yes, the man from the A-Team (whose face graced my lunchbox as a child). Note that massive "lulz" were attained when watching these.

Without passing judgement or in any way stating a direct opinion, here are the videos, in order of creation:

For additional amusement, I will direct you to the Archivas (before we were bought by HDS) viral/spoof/etc video that made it to youtube, here.

Duck typing + Wikipedia.

August 22nd, 2007 | 2 Comments | Posted in Programming, Python

For some reason, I found myself reading the Duck Typing entry in wikipedia (which is sort of like watching a slow moving trainwreck). Of more interest was the Talk page.

If you get a chance, I recommend you read both - and after your done laughing, take a look at my previous articles (rants?) on the subject - typeducking-on-duck-vs-static-typing and schrodingers-type-is-a-namespace-a-box.

I think I won in the reference material section. Although I don't think I am going to touch the wikipedia entry with a 10-foot-pole.

Are you pyLinkedIn?

August 19th, 2007 | 9 Comments | Posted in Personal, Programming, Python

Earlier this week I was having a small discussion with Doug Hellmann - I had read his announcement about the PyMotw being picked up by OnLamp guys, and saw the LinkedIn link in his blog, we connected and started chatting.

A few months ago, Grig had made a similiar post to this - talking about Python-People connecting on Linked in, and I've slowly been connecting to people within the community since then.I mentioned to Doug that I think python people connecting is a good move - many of us don't have "python" jobs - instead, we use Python at a decidedly "not python" job, where Python is one skill of many1.

Networking in this fashion can help other python-community people find contacts and jobs and the like.There is a Python-Wiki LinkedIn page - and there was some discussion around making a Python group, which is a good idea.If you're a Pythonista/Pythoneer and want to connect, see my profile hereI'm also on Facebook thanks to James Tauber - but I'm still trying to figure out how to use that.

Update to add some moreTennessee Leeuwenburg adds some thoughts: PyLinkedIn - his point has merit, and should be considered when adding connections.

  1. Although, I've managed to make python the second-most-used language where I work []

Safe Strings for Security?

August 17th, 2007 | 7 Comments | Posted in Programming, Python

I just got done reading this article "A bright future: security and modern type systems" which reminded me of the recent Django discussion around AutoEscaping - specifically "Automatic Escaping is Not a “Newbie Feature”"

Now, I've railed for and discussed (much to the dismay of my wife - I'll talk to anyone about this, infant included) "Duck" typing and why I love it - I think the ability to define your own String/File/etc-like "SAFE" objects is easier, and more attractive in python. Do you really want a compiler to enforce social and domain-specific rules for you?

The dynamic nature of the typing within python (remember -> all objects are strongly typed at runtime) makes the on-the-fly definition and creation of new types/objects which conform to a subjective series of rules (in this case: the definition of domain-specific "malicious" strings) an easy and rapid-to-do task.

With no compiler in the way to enforce the checking of the most banal of errors one could argue that although you may have defined a new Type-Like object (a Bear in a Ducksuit) there are no rules within the compiler or interpreter to enforce that that type is used at runtime or in the rest of the application. This means you must rely on social convention or some other built-in-rules system.

Perhaps you're smart about it - and when you're building your application (web or otherwise) you state that Object A accepts a "string-like" object of the SafeString type. When you defined SafeString you added some hook/method for ensuring that yes- in fact, someone was passing you a string-like-SafeString object.

I think that the concept of "$N-Like" is the key to understanding what dynamic typing within a language is.

But I've wandered off the track/point - Malicious strings are a bit of a tip of the iceberg when it comes to application design - as of the last few years it's mainly been the concern of WebApp developers who need to worry about cross-site-scripting and other style attacks where you have a large amount of two-way information.

It makes sense to add "Safe" types into frameworks (Django, RoR, Grails, etc) for web application developers. Heck - it might even make sense to create an "EscapedChar" object in the language (python) itself. But in a language that relies on N-Like semantics it makes much more sense to push that up into the implementation of the framework/webapp itself.

The definition of "malicious" is murky at times - some input that might be blanket escaped could be useful and intended for some applications, so it's important that the implementation is flexible enough to take that into account (a String-like-Safe-like-MyString object anyone?)

Now I'm rambling, dangit. I've got to go back to my String java = new JavaProgrammer(); code.

This (for the django interested) is an interesting read as well.

Shelve, (feed)caching and Shove - oh my.

August 7th, 2007 | 2 Comments | Posted in Personal, Programming

I saw over the weekend (in my limited time in front of my lonely MacBook) that Doug Hellmann had done another Python Module of the week - this time on the shelve module, a pretty cool module (that I didn't know about). To quote:

The shelve module can be used as a simple persistent storage option for Python objects when a relational database is overkill. The shelf is accessed by keys, just as with a dictionary. The values are pickled and written to a database created and managed by anydbm.

Of course, shelve is used in the other project he announced - FeedCache, a cachine mechanism he uses to cache Atom/RSS feeds.And then, a comment on both posts linked to a different cheeseshop module: Shove. Shove is like Shelve/Pickle/Object storage on steroids. It supports 15 storage back ends for object storage, and 9 different backends for caching.I have some need to be using a module like Shove for some data/object caching/sharing, so when I get a chance I'll post a trip report. 

Update: A comment pushed me over to Multishove. Hot. 

Python 3000: Help get the alpha out the door

August 7th, 2007 | | Posted in Programming, Python

Both Guido and Brett are putting out the call for help - the first alpha of Python 3000 is nearing, and they still have 11 failing unit tests that they could use some help with.

If I can, I am going to try to help with the OS/X specific ones - but being re-tooled at work and baby has cut my python-love time down a bit1.

If you are interested (and I know you are) in helping, go here:

  1. more on that later - I'm in Java indoctrination land []

More Python 3000 Questions Answered

August 1st, 2007 | | Posted in Programming, Python

Update via/from Guido - One thing I thought was interesting was this:

Not as such. The language would turn into Java-without-braces. However, you can use "argument annotations" (PEP 3107) and write a decorator or metaclass to enforce argument types at run-time. I suppose it would also be possible to write an extension to pychecker or pylint that used annotations to check call signatures.

Specifically of interest was the link to PEP 3107. I'm on the fence about the syntax, namely I have some sort of allergy to long/giant method signatures. This new system + decorators + ABCs could be either very complex, or very interesting.

Of course, that's the beauty of python: You don't actually need to use it the new features :)