[Biopython-dev] hmmpfam parser

Michael Hoffman hoffman at ebi.ac.uk
Thu Feb 5 04:20:36 EST 2004


On Wed, 4 Feb 2004, Brad Chapman wrote:

> > Mmhhh you noticed.-..the Java-like coding....I generally try to prevent
> > direct access of class instance variables, rubbed off from Java.
>
> Yes, this really isn't necessary in Biopython. It isn't terrible to
> have (in addition to direct attribute access), but does require
> extra work coding all those functions up. Generally, the Python
> viewpoint on this is that you "trust" users of your code to access
> the variables correctly. Compared to Java coders we tend to be a bit
> more easygoing about that sort of thing.

It is also worth noting that, unlike in Java, if you need to add
accessor methods in later to do some processing you can always do so
by changing the attribute into a property.

http://www.python.org/2.2.1/descrintro.html#property

This should get you all of the benefits of encapsulation later if you
want it without having to deal with all of the cruft. Until then,
YAGNI (you aren't gonna need it).
-- 
Michael Hoffman <hoffman at ebi.ac.uk>
European Bioinformatics Institute



More information about the Biopython-dev mailing list