[Biopython-dev] Martel

Andrew Dalke dalke at acm.org
Tue Sep 19 19:52:44 EDT 2000


Cayte:

>  When I ran _test in Generate.py, I received this message:
>
>Traceback (innermost last):
>  File "test_generate.py", line 3, in ?
>    Generate._test()
>  File "Generate.py", line 471, in _test
>    exp = _generate(convert_re.make_expression(re_pat))
>TypeError: not enough arguments; expected 2, got 1

Oops!  Yeah, if I don't make all of the tests accessible from one
spot I forgot the run them.  I changed the API after I wrote that
test.  It can be fixed by using {} at the second parameter.

    exp = _generate(convert_re.make_expression(re_pat), {})

The second parameter is a dictionary of names needed for group
references, like the \1 in r"(?P<blah>....)\1".  (It's a dict
instead of a list because I like the O(1) lookup performance,
and because the parameter is not exposed as part of the API.)

I'm cleaning up the code now, including changing the names to
be more consistent.  I'll include moving all of the tests to
the test directory instead of including them in the module.

                    Andrew
                    dalke at acm.org





More information about the Biopython-dev mailing list