Joe Amenta's Blog

July 31, 2010

Fixer for keyword-only arguments

Filed under: 3to2,GSoC 2010,Google Summer of Code,Work — AirBreather @ 1:50 pm

I have finished the fixer for keyword-only parameters.  This includes things like this:

def spam(arg1, arg2, *, kw_only_arg1, kw_only_arg2): pass

The param list would fix to: (arg1, arg2, **_3to2kwargs), and the body of the function would immediately look for ‘kw_only_arg1′ and ‘kw_only_arg2′ in the _3to2kwargs dict, assign to their respective names, and delete the values from the dict.

Special considerations are made for when the *args and the **kwargs params exist.  Check the test cases for exactly what happens.

Note that this fixer is VERY sensitive to incorrect code, so as always, make sure that code actually works in Python 3 before running it through 3to2.

July 27, 2010

Back into the swing of things

Filed under: 3to2,GSoC 2010,Google Summer of Code,Work — AirBreather @ 2:08 am

I’ve managed to get myself back to coding after an unexpectedly long absence.  I built up a lot of inertia over all that time, so I’m glad to finally overcome it.

I did hit a snag related to my laptop’s Ubuntu installation; this results in me not being able to run the 3to2 tests right now.  I’ll just commit what I have (the recent change probably does what I think it does, but it’s disabled by default so that it doesn’t bother anyone) and work through this tomorrow.  Shouldn’t take more than a few minutes when I’m fully awake, but I’ve learned from experience that I shouldn’t try to do significant sysadmin stuff this late at night if it’s not time-critical.

July 23, 2010

RL just ate my week

Filed under: 3to2,GSoC 2009,GSoC 2010,Google Summer of Code,Personal,Work — AirBreather @ 5:09 pm

This past week, I’ve just had SO many important things going on in real life.  I’m going to start coding again after this weekend (that’s Monday, July 26), when everything should be settled down.

Currently on my plate is a fixer for the extended funcdef parameter syntax.  I’ve already got tests in the repository, just need to work on implementing the fixer.

On a side note, I’m rather proud of how well lib3to2 does with the Py3k standard library.  Most modules I’ve tried just work, and those that fail tests often fail for other reasons than lib3to2 failures.  For example, lib3to2 doesn’t refactor the io module to fully pass its test, because the io module expects the _io module to behave a certain way.

July 14, 2010

Back from Break

Filed under: 3to2,GSoC 2010,Google Summer of Code,Personal,Work — AirBreather @ 12:25 am

I went to Chicago this weekend and just got back tonight.  Back to work tomorrow!

Edit: OK, maybe not today, I need a few days to chill and get my motivation back.

Powered by WordPress