Sometimes, more than one method of a PyProtocols generic function (or entry in a Dispatcher object) applies in a given circumstance. For example, you might need to sum the results of a series of pricing rules in order to compute a product’s price...
With PyCon just a few weeks away, I’ve been throwing together my slides for the presentation on generic functions, and I’m short a few examples and diagrams. The tricky part is that you can’t fit much text on a slide, so I need to come up with some...
Ah, the smell of fresh-baked bread. Or maybe it’s fresh-cut wood, depending on your choice of metaphor for programming.The last couple of weeks, I’ve been working on a prototype platform API for Chandler, called “Spike”. It’s purely a speculative...
…microseconds, that is.Just when I thought I couldn’t possibly pull any more optimization tricks in pure Python, I found a couple more tonight. First, it occurred to me that because generic function wrappers use a dispatcher instance’s __getitem__...
This weekend, I took another crack at trimming microseconds off the common-case path for generic function execution, and succeeded in dropping the excution time from 13.2 microseconds to just over 9.8. (Which is about 9 microseconds overhead added...
Politics-Oriented Software Development: “Also remember that someone who points out a problem early is a troublemaker; someone who fixes a problem at the last minute is a hero.”The Core Protocols (page 3): “When I believe I have a better idea than...
Since I’m claiming that my PyCon presentation will be on “efficient” rules in Python, I thought this weekend that it might be a good idea to actually measure the performance of the current generic function implementation in PyProtocols.For the...
It’s amazing how hard it is for me to write a well-formed to-do list, at least in terms of David Allen’s “Getting Things Done” methodology. For example, for almost two weeks now my to-do list has included the items “Clean whiteboard” and “Clean...
In my second professional programming job, I had a really interesting boss. When we had a design meeting, we would all sit around a whiteboard, and as Roger (my boss) threw out things we needed to accomplish, the other programmers and I would...
“You ain’t gonna need it.”’nuff said.
I’ve just posted a partial draft of a pre-PEP proposal to add what I’m calling “monkey typing” to Python. It’s an extension of the infamous “duck typing” concept that seeks to simplify the use of interfaces in Python to the point where they scarcely...
Aninteresting dissertation suggests that in the future, quite a lot of applications might be able to be defined in terms of a generic editing framework like this one.The Proxima prototype is written in Haskell and uses wxHaskell for the GUI. It...