[[!meta title="Splittable **kwargs"]]
[[!meta date="2008-12-21 02:40:44"]]
+[[!template id=gitrepo repo=splittable_kwargs]]
Ah, it has been a while, but I am excited about a new python module I
wrote so I shall post again ;). Actually, there has been a lot of
wrong with my cantilever calibration software :p. Since I'm using git
for versioning, I naturally wanted a 'distributed bugtracker'.
Luckily there are a number of nice ones out there. I've been using
-[Bugs Everywhere](http://bugseverywhere.org/be/show/HomePage). My other
-favorite is [Ditz](http://ditz.rubyforge.org/), but I like being able to
-hack away on BE in my familiar Python.
+[Bugs Everywhere][BE]. My other favorite is [Ditz][], but I like
+being able to hack away on BE in my familiar Python.
Besides helping keep track of my bugs, I've enjoyed hacking away at
BE. In the process I've learned some cool tricks such as [Python
-decorators](http://www.python.org/dev/peps/pep-0318/) (see [this
-tutorial](http://adam.gomaa.us/blog/the-python-property-builtin/) for
-some really neat examples) and [Bash
-autocompletion](http://www.debian-administration.org/articles/317).
+decorators][decorators] (see [this tutorial][AG] for some really neat
+examples) and [Bash autocompletion][bash].
Meanwhile, the calibration code developed, and I was getting tired of
keeping assorted keyword arguments default in sync (how many times do
I have to repeat minFreq=500?). The way to avoid repeating yourself
-in this situation is to use [`*args` or
-`**kwargs`](http://docs.python.org/tutorial/controlflow.html#keyword-arguments)
-(see [wxPython's endorsement](http://wiki.wxpython.org/wxPython Style Guide#line-42)).
-I don't trust myself to keep my code in sync enough to use *args, so
-lets focus on **kwargs. Consider the following example:
+in this situation is to use [`*args` or `**kwargs`][kwargs] (see
+[wxPython's endorsement][wxPython]). I don't trust myself to keep my
+code in sync enough to use *args, so lets focus on **kwargs. Consider
+the following example:
>>> def A(a=1):
... return a
TypeError: A() got an unexpected keyword argument 'b'
Hmm, how to split the kwargs into those for `A` and those for `B`? So
-I wrote the [splittable_kwargs
-module](/~wking/code/#splittable_kwargs). See the docstrings
-for some usage examples and more info. With my module the above
-example becomes
+I wrote the `splittable_kwargs`. See the docstrings for some usage
+examples and more info. With my module the above example becomes
>>> from splittable_kwargs import splittableKwargsFunction
>>> @splittableKwargsFunction()
archiving, command-line grade database. Down with web-forms ;).
More information to come as the project progresses.
+[BE]: http://bugseverywhere.org/
+[Ditz]: http://ditz.rubyforge.org/
+[decorators]: http://www.python.org/dev/peps/pep-0318/
+[AG]: http://adam.gomaa.us/blog/the-python-property-builtin/
+[bash]: http://www.debian-administration.org/articles/317
+[kwargs]: http://docs.python.org/tutorial/controlflow.html#keyword-arguments
+[wxPython]: http://wiki.wxpython.org/wxPython Style Guide#line-42
+
[[!tag tags/linux]]
[[!tag tags/programming]]