Thoughts on Python

What's Happening at Mozilla? [2011.09.19]

Most people at Mozilla are remote so each quarter we sync up face to face as a group for an all-hands meeting. There are over 600 employees! We of course sync up in smaller groups more frequently but this is a chance to see what's going on across the entire Mozilla horizon. So what's happening at Mozilla? We're on the cusp of a huge shift towards an open web platform. That is, something more than a web browser -- something you can run "native" apps on. There's a lot of work left to do, of course. Here is a random dump of interesting projects in the works...

Read article

Fudge Goes 1.0 [2011.02.25]

Fudge, the python mock tool, goes 1.0! You can grab it with pip install -U fudge or directly from PyPI. This marks the end of a long incubation period where the community and I used Fudge in real world scenarios to see what worked and what didn't. I'm sure there are many more improvements to make but as of 1.0 I'm very satisfied with what we've accomplished. This is thanks to its small but vocal community of users, to all contributors and to everyone who pointed out flaws...

Read article

The Promise of the Cloud [2011.01.05]

As web developers we are faced with this problem: how do we scale up our code to handle high traffic? A lot of time and engineering goes into this problem -- time to simulate the traffic we expect and add servers to our cluster, cache heavy database access, etc, in anticipation of the load. Time is precious. This time could be spent optimizing the usefulness of our web product and creating interesting content. No one really congratulates you when a website works, they expect it to work. When Google App Engine was released their pitch was...

Read article

I've Joined the Web Dev Group at Mozilla [2010.11.30]

Whenever I'd hear about someone from the Python community getting hired by Mozilla I'd get really excited because I knew they'd continue to share and collaborate in the open source world that I was a part of. So here I am about a month into joining Mozilla myself to work with the WebDev team. Everything Mozilla does is right out in the open: ideas are posted on blogs, code is committed to public repositories--free to use, free to fork, etc. They take a firm stance that everything you do on the web should be free and open even to the point where the new Firefox 4 audio API (which is amazing) doesn't even support the patented, closed MP3 format despite its ubiquity. This transparent approach to technology is really powerful...

Read article

Compiling Python 2.5 on Mac OS X 10.6 (Snow Leopard) [2010.11.06]

The Mac dev community has outgrown Python 2.5 it seems but you might still need it if, say, you work on a Google App Engine project. I recently set up a fresh new Snow Leopard machine and really didn't want to eff it up with Macports. I like Macports but it leaks dynamic libraries here and there and this screwed me on my last machine. Instead I've had good luck with Homebrew (so far) but I couldn't find a Python 2.5 recipe anywhere. Snow Leopard ships with a version of Python 2.5 but I ran into some trouble with it as soon as I tried using virtualenv. Apple usually messes up Python in some way so I figured I'd just compile one. Since I couldn't find anything succinct while searching online here are my notes...

Read article

Python Package Index (PyPI) Mirrors [2010.07.27]

Most deployment systems depend on PyPI, the Python Package Index, for fetching and installing dependencies. Although performance and reliability has greatly improved, there are still days when you may find PyPI down and thus are unable to deploy through the normal fashion. Fi...

Read article

PyCon 2010 - Get Your Proposals In [2009.09.29]

Proposals for talks at PyCon 2010 are due October 1st. That's in two days! PyCon is really a little more like an unconference and is an excellent place to share your ideas or showcase your work to the Python developer community. If you're having fun with something Python r...

Read article

Fixture 1.3, Now With That Tangy Django Flavor [2009.09.24]

The fixture Python module is a utility for managing data needed for automated tests. Its new version, 1.3, adds support for the Django backend. This was a champion effort by Ben Ford who wanted an alternative to Django's own JSON / YAML based data loading mechanism. Thanks...

Read article

Why you should NOT license your code as GPL [2009.07.16]

Zed Shaw recently wrote a clear and concise defense for why he used the GPL on Lamson. I've seen a few mentions on twitter that alarmed me because people seemed to think now is the time to release all software as GPL. Here's what you need to ask yourself before you license your code as GPL. First, do you have a business plan that involves selling your software? Most people do not, most business plans have to do with actually using custom software. If that's you then your software and your business become better as more developers work on your software. I.E. when your software is applied to more real world situations, more bugs are fixed and more patches for features are received. GPL does not help you gain users because it shuts out most commercial enterprises ...

Read article

Nose 0.11 released (nifty new features) [2009.05.07]

Nose 0.11 has just been released. Woo! This has been a long time in the making and got a nice boost from many devs sprinting during PyCon. Here are its nifty new features: Vastly more readable documentation with a ton of new documentation added. Parallelize your test run...

Read article

Degradable Ajax by Sharing Mako Templates With Dojo [2009.05.05]

For a Pylons site I have been working on I wanted to provide Ajax functionality for the users but also allow the content to be crawled by search engines. Let me point out that not all of the Ajax content needs to degrade to static HTML, only the content that a user might search for on a search engine. Some people might decide that none of their site needs to be crawled by search engines, say, if it was Gmail or something similar. Since the site is using Pylons it also uses Mako for templating and on the JavaScript side it uses the Dojo toolkit. The easiest way to render content dynamically (via altering the DOM in JavaScript) and render static HTML seemed to be by sharing my templates between Pylons and Dojo. While probably not the most elegant solution, here's how I did it ...

Read article

The Python Packaging Problem [2009.03.30]

At PyCon 2009 the fact that Python needs to solve the "packaging problem" came up a few times. This is not a new discussion. However, the problem is still not completely solved so here I'll point out the details of the problem, the unsolved parts, the solved parts, and how the solved parts could be solved better ...

Read article

PyCon Happenings [2009.03.26]

I really like PyCon. It's been said many times but is worth repeating: the hallway track is what makes PyCon such a fun unconference. With that said, here are some happenings: I'll be talking Friday after lunch about some fun I've been having trying to test Ajax web appli...

Read article

Fudge 0.9.2 Released [2009.03.20]

Just a quick note that there is a new version of Fudge, a mock and stub library for Python. This fixes a lot of bugs in the old release and adds some nice new features: You can now declare method expectations more expressively using argument inspectors. Declaring an expected...

Read article

A new version of Fudge, mock object library for Python [2009.03.10]

I just released 0.9.1 of the Fudge module which is a tool for working with fake objects while testing Python code. Some call these mocks, stubs, or actors, but I just call them all fakes because that way you don't have to change the names in code if you update your tests. Yo...

Read article

What Makes Pylons Stand Out As a Web Framework [2009.02.23]

After 6 release candidates, Pylons 0.9.7 final has been released. Big congrats to all developers. Although it's just a point release, I think this is a huge milestone for Pylons for one reason: It has proper documentation! I've been using both Pylons and Django for several web applications and Pylons' old docs were sparse and hard to navigate. This didn't stop me from digging in and playing around with the framework but for a project to really reach a wide audience it needs well-organized, readable documentation. I can think of many well designed, solid programming tools that have failed because, simply, their docs were not readable. There is a difference between having comprehensive documentation and having documentation that is readable. Django got this right from day one. As a Pylons user, I'd like to point out a few reasons why I like it and some reasons I don't. It's not meant as a fair comparison to Django, but Django is the only other web framework I know pretty well so it is my point of reference ...

Read article

Googlebot's Fatal Flaw And How You Can Fix It (or Get Rich Trying) [2009.02.12]

I came across this article today on Coding Horror about how Google has a monopoly on search engines and how something must be done about it. I'm not one who falls into the "Google Is Evil" camp; I actually think they are a benevolent force in the world :) However, as with any monopoly, the lack of competition stifles progress. And when I think about the state of today's technology, I can't help but wonder why Google has not fixed the most fatal flaw in their Googlebot : It does not behave like a web browser. Search engines are made for people and the majority of people browse the Internet with a web browser. The first comment on the article is a cry for help: "What can we do?" I have an answer to that question. And you can take my answer and turn it into a business plan and climb the golden staircase to success. Any smart investor would be begging you to take their money. Google generated $5.37 billion dollars in Q2 of 2008 and their flagship product doesn't even work! In fact, I'm going to give this to you all for free; all I ask is that you visit me one day and say thanks. Are you ready?

Read article

Fudge: Another Python Mock Framework [2009.02.03]

I'm excited to announce the release of Fudge, a Python module for replacing real objects with fakes (mocks, stubs, etc) while testing. Fudge started when a co-worker introduced me to Mocha, a mocking framework for Ruby and a simpler version of jMock (Java). Up to that point I had been building mocks "by hand" in Python with a post mortem approach; I'd set up some fakes then inspect their call stacks at the end of the test. I like the jMock approach better—you declare a fake object that expects methods and arguments, you replace the real object with the fake one, run your code, and you're done. If your code doesn't live up to the expectations then your test fails.

Read article

Debugging doctests interactively [2009.02.02]

Jens W. Klein has just released a pretty cool doctest debugger tool called interlude. It's designed for a situation where you are writing doctests (perhaps in the comments of your code) and you think to yourself, hmm, what happens when I run this test? Instead of the back and forth run-test-edit cycle, well, why not just drop into a doctest session from your test suite, interact with the shell until you got it right, then copy / paste the session back into your comments? This little tool is genius. And surprisingly simple: 11 lines long (3 of those are for the shell startup message). Jens describes an installation process that involves invoking a custom doctest runner. This can introduce a bootstrapping problem, especially if you are using a doctest runner like Nose because it's hard to customize the doctest runner. Well, actually, this bootstrapping step isn't even necessary. Here's an example ...

Read article

Chicago JavaScript Meetup: JS.Chi() [2009.01.24]

I went to my first Chicago JavaScript meetup on Thursday (the 4th meetup they've had so far) and it looks like a promising group. The topics were pretty basic but the speakers seemed very deep into JavaScript so I'm looking forward to future meetings. By raise of hands we decided to split into two groups, an advanced and a beginner, which was an excellent idea. The turnout was incredible — about 60 (or more?) people showed up. The original venue that got canceled only held 40 so some of those people were actually on a waiting list ...

Read article

Python 3.0 On Mac OS X (alongside 2.6, 2.5, etc) [2008.12.05]

Python 3.0 is out. Woo! Some people have been saying that they'd like to be able to run it alongside 2.6, 2.5, etc to test it out. Well, Python is actually designed for this. All you have to do is build it with make altinstall and that will give you a python3.0 binary without touching your default python binary. But on Mac OS X it's a little different ...

Read article

Are you hiring web developers? [2008.12.03]

As the US economy spins into a death spiral I unfortunately now know some highly skilled web developers (Python, Ruby, JavaScript, etc) in the Chicago area who are looking for work. And I mean highly skilled people whose ninja like qualities will be sorely missed. Most hiri...

Read article

Try out the Mercurial Subversion extension (hg svn) on Mac OS X [2008.11.03]

As a Subversion user, I am hesitant to get excited about distributed version control systems (DVCS). What I like about Subversion is that there is a central line of development. This is great for teams because it forces them to integrate their code often. This is great for open source projects because the users have one place to go to get the source; there is one version of the truth. However, I usually hack on code during my train commute to work and one thing Subversion does not [yet] do is let you commit offline. This is all I want and this is what a DVCS can provide. Everything else is nice to have. It's nice to have an experimental work space where I can create private branches all day and all night but you can do this in Subversion too. Experimental work branches are dangerous if they do not get integrated with mainline development often. Using a DVCS makes it easier to be lazy about integration. DCVS lets you maintain mirrors of projects, potentially with your own patches to the project. While this is convenient, I also put this in the dangerous category because the last thing I want is for someone to say, yeah my Django patch wasn't accepted and probably never will be, so just use my clone of the repository! This is an integration nightmare. Anyway, Subversion is a long way from supporting offline commits so I've been experimenting with Mercurial ...

Read article

Automated Model Based Testing of Web Applications (GTAC 2008) [2008.10.27]

Last year at the Google Test Automation Conference (GTAC) 2007, the talk by Atif was one of my favorites. He had been working on a system of model based testing for desktop GUI applications (affectionately called GUITAR) and hinted that he will be applying the work to web applications next. Now, at GTAC 2008, here is a taste of what his dept. has been up to. The talk is by Oluwaseun Akinmade and Prof. Atif M. Memon. Both are at University of Maryland. The idea of automated model based testing hints at a future where software can be used to figure out how to test itself. That is, when software is modeled in a way that exposes inputs, outputs, event handlers, and end-points, then introspection can be done to find all possible interactions within an application and test them. Yes, it is one step away from artificial intelligence. This is fascinating to me but I think it still needs a lot of work. Atif is asking for as much feedback as possible from industry professionals to find out how this can best be used in the real world. Here are my notes from the talk ...

Read article

Taming The Beast: How To Test an AJAX Application (GTAC 2008) [2008.10.25]

This was one of the talks at GTAC 2008 that I was most looking forward to before the conference. It was excellent, I was not let down. The talk was given by Markus Clermont and John Thomas who work at Google. Since the talk was right after lunch they decided to take a Q & A approach. It sort of went off in tangents at points but overall the format seemed to work. In my own work I've been struggling at maintaining a now bloated test suite for an AJAX website but their approach made something click in my head. I'm already working on a refactoring plan. Here is my abbreviated interpretation of the talk ...

Read article

The Future of Testing (GTAC 2008) [2008.10.24]

Google Test Automation Conference (GTAC) is my all-time favorite conference. It's free. It's on a single track — this means you don't miss any talks and everyone experiences the same journey of thought. Also, since you have to apply for admittance with a short essay, everyone who attends is really passionate about testing. It's still sort of "underground" which keeps it small and very social. Last year, I made some kind of attempt to live blog summaries of the GTAC talks but I never made it past part 1. We'll see how far I get this year, stay tuned. The videos for 2008 aren't online yet but check youtube often because last year they were up in less than a day. The Future of Testing was the first talk of the GTAC 2008 conference on Thursday Oct 23rd given by James A. Whittaker, a very entertaining speaker who works for Microsoft. His talk was excellent and I highly recommend keeping a lookout for the video. Here are my notes...

Read article

Presenting a Solid Tutorial at PyCon [2008.09.26]

Proposals for tutorials at PyCon 2009 are now being accepted through October 31st. Due to many projects I have going on right now I probably won't be able to propose a tutorial myself but I thought I'd share some thoughts from last year...

Read article

T'is be'a Fixture 1.1.1 fer ya! [2008.09.19]

Y'aharrr me seabound mateys! Thar be'a fine gully of'a wind shakin' ye jigger today as m'announce a new release of Fixture, a python module fer loadin' and referencing test data. O'er yonder ye find a cap'n's Changelog fer ye royal subjects. Riches abound! Booty abaft! ...

Read article

Web Frameworks Do Not Make DBAs Happy [2008.09.16]

A colleague of mine, Shaun Thomas, is one of a few database administrators who manage all our company's databases by monitoring, optimizing, partitioning, building star schemas, etc. The DBAs also maintain standard operating procedures for how to name a column or how to refe...

Read article

Real Test Engineers Love Dots [2008.09.10]

"The world's largest particle collider passed its first major tests by firing two beams of protons in opposite directions around a 17-mile underground ring ... After a series of trial runs, two white dots flashed on a computer screen at 10:26 a.m. indicating that the pro...

Read article

It's Time to USE The Web : Mozilla Labs Releases Ubiquity [2008.08.27]

Mozilla Labs releases the Ubiquity add-on for Firefox. In a nutshell: With search, users type what they want to find. With Ubiquity, they type what they want to do. Big congrats to Aza and everyone else who worked on this! As innovative as Humanized was, building somethi...

Read article

aintjustsoul.net: A portable record player for the Internet [2008.08.18]

I'm very pleased to announce a website I just launched: http://aintjustsoul.net/ I'm calling it "a portable record player for the Internet" because I'm a record collector myself and listening to as much music as possible has been the best way to expand my collection. Yep...

Read article

Chicago's Google App Engine Hack-A-Thon Recap [2008.07.31]

Today was Chicago's Google App Engine Hack-A-Thon and I managed to get some good work done. Well, I had planned to make packages more ephemeral on the PyPi mirror since it quickly hit the 500MB limit as is. But instead I decided to add Datastore support to the fixture m...

Read article

Fixture Goes 1.0 (Testing With Data In Python) [2008.07.18]

I've just pushed 1.0 — the I Heart Data release — of fixture, a Python module for loading and referencing test data. It is used heavily at my work in two test suites: one for the functional tests of an ETL framework and another for a Pylons + Elixir (SQLAlchemy) ...

Read article

An In-Process, Headless Web Browser for Python? [2008.06.12]

Yesterday, Atul Varma announced he had resurrected python-spidermonkey, John J. Lee's project to run JavaScript in Python. Woo! Spider Monkey is the JavaScript runtime that Mozilla (i.e. Firefox) uses internally. However, it's just an engine and doesn't deal with the DOM o...

Read article

After the release of Google App Engine, the Rubyists ... [2008.05.05]

... learn Python? No. They try compiling Ruby to Python bytecode, naturally. One has to admire their pride, I guess. The funny part is this might actually work. As the article points out, Ruby's opcode structure was inspired by Python's (I had no idea it was so similar, ...

Read article

Making Erlang indentation-sensitive [2008.04.28]

Ulf Wiger has been experimenting with making Erlang indentation-senstive. He followed up with a Part 2 after comments. For most people who start working in the Erlang language, the most annoying new concept is all the various line-terminators you have to know. Damien Kat...

Read article

The Python Make tool [2008.04.22]

A while back there was a lot of talk about needing a Make tool for Python, one like Ruby Rake. There are a few packages now: SCONS A software construction tool zc.buildout System for managing development buildouts ... and more recently: Vellum Vel...

Read article

Testing Google App Engine sites [2008.04.17]

The Google App Engine SDK sets up a fairly restrictive Python environment on your local machine to simulate their runtime restrictions. Roughly this consists of no access to sockets and thus barely working httplib, urllib, etc (replaced by urlfetch.fetch()), inability to...

Read article

PyPi (Cheeseshop) on Google App Engine [2008.04.15]

Like many of you, I've had my jaw on the floor since the release of Google App Engine. Although there are skeptics out there, a careful read of their terms will show you that it's for real — Google has released GOOGLE to the world and it's not for scary marketing purpos...

Read article

Unicode In Python, Completely Demystified (slides available) [2008.03.15]

Big thanks to everyone who attended my talk at PyCon today, Unicode In Python, Completely Demystified. It was an ambitious title; I highly doubt I "demystified" everything, but I was happy with how it went. There were a ton of great questions — even some I c...

Read article

Data mining in Python and beyond? [2008.03.12]

Dear Lazy Web, I am a software engineer who hasn't done any college level math (gasp!). Recently, I've been having a lot of fun transforming data into more meaningful data. This, I believe, is more commonly known as data mining and I'd like to learn more about it. Spec...

Read article

The Monty Hall Problem (win a goat or a car) [2008.02.13]

There is a puzzle used in game shows known as The Monty Hall Problem. It's been around for a while but over lunch yesterday someone explained it to me for the first time and 3 out of 4 of us argued convincingly the same answer. And it was wrong. Here's the problem: Suppo...

Read article

Building Flash/ActionScript sites entirely in code and using FireBug for debugging [2008.01.28]

Way back in the olden days I used to dabble in Flash for building dynamic websites. This was incredibly painful, as I recall, because I couldn't stand the Flash IDE. It was clunky and hard to navigate, there weren't enough key commands, and the code editor was a sad version...

Read article

Converting ReStructuredText to Wiki syntax [2007.12.21]

I just released a little package called wikir that attempts to convert reStructuredText to Wiki syntax. Why? Mostly because I have a lot of projects hosted on Google Code and reStructuredText is my documentation weapon of choice. It's also widely supported in the Python w...

Read article

Software is written by hand [2007.12.21]

...that's right, it's not molded or prefabbed, it's not made on a production line or in a lab. Are we insane??! Here is a hilarious probe into the darker side of this art we call programming.

Read article

Leapfrog Online is looking for some Django developers (Chicago area) [2007.12.13]

Leapfrog Online is looking to hire several Python developers to work on a Django site. If you know Python but not Django, this is an excellent opportunity to learn. If you know Django but want to learn how to use Python in other contexts, you'll get to do that, too. You'll...

Read article

WSGI Intercept Has A New Home [2007.12.03]

A while ago I started using Titus Brown's wsgi_intercept module to test some XML services I had been working on. It was a great way to set up a stub response so that the tests never hit our real services. We even created a nifty little decorator that would look for an envir...

Read article

importing modules from setup.py (chicken vs. egg!) [2007.11.20]

There's a chicken vs. egg problem when you want to import 3rd party packages in a setup.py file. I often want to import my main module so that I can use inspect.getdoc(my_module) for the description in my setup function (avoids duplication). But if a user is running python ...

Read article

How To Get Started Writing Open Social Applications [2007.11.18]

I started learning about Google's Open Social API and gave a lightning talk on it at the last Chicago Python User Group meeting. It wasn't much more than a brief overview and fodder for "diving in" to the Open Social platform. Here it is again, in more of a tutorial fo...

Read article

Pycon in Chicago, Excited Yet? [2007.11.14]

I freaking love this town. Who's up for a sprint at the Billy Goat Tavern?? Pycon 2008 site

Read article

GTAC Highlights Part 1 - Selenium is Alive and Well, Model Based Testing Is Smart, And... [2007.08.25]

I just got back from the GTAC (Google Test Automation Conference) in New York and had a great time. It spanned 2 days and had a single track — this made it very laid back (no headaches trying to decide what talk to attend) and the timing was perfect. Especially since my travel...

Read article

Python on TextMate demo (Chicago area) [2007.08.08]

If you are in or around the Chicago area, I will be demo-ing some techniques for coding Python in TextMate, an editor for Mac OS X. It's part of the Snakes On Apples themed Chipy (Chicago Python Users) meeting. It's at 7pm, Thursday August 9th; click the link for more info ...

Read article

Hacking python frames [2007.07.18]

At the last ChiPy meeting, Ian Bicking showed a fun little hack to install a doctest output checker from within a running doctest. The hack goes so far as to backtrack through the internal frame stack, locate the doctest frame, change some of its local vars, then switch out...

Read article

fileinput : nice module for file processing [2007.07.03]

Of late I've been writing scripts that scrape logs to fix data. groan. Well, at least this was a nice discovery: the fileinput module in stdlib (since 2.3? not sure). Some code ... import fileinput outf = None def add_woot(line): global outf if outf is None: outf = open(...

Read article

context_tools, bridging the gap between test methods and test classes? [2007.06.26]

Collin Winter just released context_tools, which strikes me as a step towards bridging the gap between test methods in nose and test classes in unittest/py.test/nose/etc. Currently, it can be hard to refactor tests that start as simple test methods when later you decide to u...

Read article

Going to the GTAC (Google Test Automation Conference) [2007.06.21]

UPDATE: Here were my highlights (part 1) I just like saying GTAC "G-TACK," it rolls off the tongue nicely. It's funny when you hear techie things said out loud that you've only see on the screen. At work, I just interviewed a Software Engineer candidate who has used scotc...

Read article

What does the def-star-variable (or def-asterisk-parameter) syntax do in Python? [2007.06.20]

Inspired by Titus' blog post about Python's elusive at sign I thought I'd drop a little google egg for anyone who is learning Python and hasn't read the manual cover to cover yet (like I did ... yeah, right). If you see a def in python with asterisks (or stars), like so: ...

Read article

documentation for fixture module [2007.04.17]

In a mad sea of too-busy-to-blink I've managed to write documentation on the fixture module for python. If this interests anyone could he/she please let me know how the docs read? Too much? Too little? Hard to navigate? Examples too complicated? Thanks. For reference,...

Read article

multiple inheritance woes [2007.03.29]

multiple inheritance in python starts to fall apart when you want to mash together two very similar objects. I haven't found a clean way to get this example to work (without hardcoding the super calls to self.rollback_db() or doubling up implementations of rollback_db, both ...

Read article

testing just got easier (a few nose plugins) [2007.03.22]

While procrastinating on writing documentation for fixture I managed to code up a few nose plugins. (Seriously though, the fixture docs are nearing a stage of completion, I swear it!) If you're not familiar with nose and its nosetests command for running test files, then i...

Read article

unicode and unicorns [2007.03.12]

Feihong Hsu gave an excellent talk on handling unicode in python at the last ChiPy meeting. The slides are there on his blog and if you missed the talk, they are still a logical read. He also posted his demos which contain much useful code for working out common problems. H...

Read article

Live doctest in TextMate (IPython + Twisted?) [2007.03.01]

I use TextMate for all python dev and I've had this idea to make typing doctests yield live results. In other words, when you are editing a module, if you were in a doctest you would type a line of code and the next line of your module would contain the result. Just imagin...

Read article

PyCon: A Star Schema in pure python code? Is this guy INSANE? [2007.02.24]

Steven Lott gave a talk roughly about implementing the star schema in Python (slides) suggesting that ETL operations—that is, the process of extracting, transforming, and loading data into a dimensional model (the Star Schema)—then analyzing that data can be done ...

Read article

You vs. The Real World: Writing Tests With Fixtures (Sunday at Pycon!) [2007.02.19]

I've been having some trouble trying to edit my proposal summary (maybe it's not possible anymore?) so I wanted to point out that the talk will cover the fixture module, not the testtools.fixtures module. This is actually a new module, a rewrite of the testtools one from scra...

Read article

Why People Don't Use Hand Dryers [2007.02.14]

It's because they don't know that you have to 1) wring out or shake off extra water then 2) rub your hands vigorously under the dryer. If you don't do that, it doesn't work (unless it's some turbo dryer I've seen in restaurants recently). Most dryers do not have these instr...

Read article

2 stupid things I coded this week [2007.02.09]

#1 try: do_stuff() except: etype, val, tb = sys.exc_info() raise etype, "%s (%s)" % (val, "happened in the context of X"), tb #2 class UsedToBeADict(object): foobar = make_foobar('with sugar'), bazbar = 1 fezbar = 2 If you don't see the mistakes al...

Read article

Coffee! ... and python [2007.01.31]

I'm going to try my first Tech Coffee—early morning coder's meetup—this Thursday to work on the fixture module somewhere other than the purple line to and from work. When Tech Coffee first started it was on Mondays. That was the worst idea, ever. The last thing ...

Read article

Housecall from the pydoctor (finally, a doc generator that works!) [2007.01.24]

On a fair day in a far away land there was once pydoc, a cunning warrior indeed. Generating docs for distribution wasn't too hard, just a few lines like ... os.chdir(build_dir) src_dir = os.path.basename(mymod.__file___) pydoc.writedocs(src_dir, '%s.' % mymod.__name__) ...

Read article

Generating python with python [2007.01.17]

I've been working on this generate command that creates fixture code from an existing database and, I just have to say, I really like that I can do: template.add_import("from %s import %s" % (cls.__module__, cls.__name__)) It just feels so ... right ;)

Read article

Python gets true closures in 3000 - do I care? [2006.12.02]

Really the only thing stopping python 2.x from having closures like how Martin Fowler defines them is that, aside from the global module space, you can't re-bind names in enclosed scopes; you can only have a local reference. An *ahem* unnamed coworker of mine who mainly uses ...

Read article

You vs. The Real World: Testing With Fixtures (Coming Soon) [2006.11.30]

I'm very pleased to announce that my proposal for a talk at pycon 2007 was accepted (#83). I'm pretty new to pycon but, wow, what a tough time this year the reviewers had! 104 submissions, only 50-60 could be accepted; ouch. The talk is titled You vs. The Real Wor...

Read article

Creating a subversion checkout/ dev target for easy_install [2006.11.29]

I was a little confused by setuptool's explanation of how to make an egg installable as easy_install yourproject==dev How do you tell it where your repository is? You actually have to put a URL somewhere for setuptools to find. I.E. In the long_description, the body of t...

Read article