[Biopython-dev] Notification: incoming/59

Brad Chapman chapmanb at arches.uga.edu
Thu Feb 14 08:55:55 EST 2002


Hi Stephan;

> JitterBug notification
> new message incoming/59
[...]
> Traceback (most recent call last):
>   File "sprot.py", line 3, in ?
>     from Bio.SwissProt import SProt
>   File "/home/people/share/sw/external/src/biopython-1.00a4/Bio/SwissProt/SProt.py",
> line 554
>     self.data.annotation_update = cols[1], int(self._chomp(cols[3]))  #<=
>        ^
> IndentationError: expected an indented block

I'm confused. I can't reproduce this error with release 1.00a4 on either
UNIX (FreeBSD) or Windows. It looks like the line that causes the
problem is on 534 in the original file, so I guess you have been
modifying this file? 

> Note: why don't you just use all-tabs for indentation?
> We do this since some time as it just makes life so much
> easier!!

As far as I know, we all tend to use the all-spaces style. This has the
advantage of looking exactly the same in all editors, and I think is the
way code in the main python distribution is being written. The more
popular unix editors like emacs and vim do the 4 spaces indentation
automagically. Anyways, it's all a matter of preference.

If you have been mixing spaces and tabs in the code that is going to
cause the indentation problems. You can do:

python -t <your_script>

to look for tab/space mixing problems. Python comes with
Tools/scripts/untabify.py, which can convert tabs and spaces, and you
can also do this in text editors, etc.

Hope this helps!
Brad



More information about the Biopython-dev mailing list