[Biopython-dev] [Bug 3046] PhyloXML, please define get/set methods

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Tue Apr 6 22:35:17 UTC 2010


http://bugzilla.open-bio.org/show_bug.cgi?id=3046





------- Comment #2 from joelb at lanl.gov  2010-04-06 18:35 EST -------
(In reply to comment #1)
> I'm very tempted to mark this as "won't fixed", this is Python not Java
> (grin) and get/set functions are ugly.
> 
> The actual functionality you are looking for might be expressed using explicit
> Python properties though (which would show up using dir(tree) etc). I'd need
> to see some examples to comment on the specifics.
> 

Hi, Peter,

Actually, I was thinking that the PhyloXML interface is *too* Java-esque.  The
functionality I'm trying to get was summarized in the previous feature request,
namely a concise list comprehension such as:
[node.set_property(prop_arr[i], *prop_params,  **prop_keywords) 
            for i, node in tree.enumerate_internals()]

Obviously this could be done without explicit get/sets as

  [node.__setattr__('property', PhyloXML.Property(prop_arr[i], *prop_params, 
**prop_keywords)) for i, node in tree.enumerate_internals()]

if property was actually settable, although that's ugly too.  Unfortunately you
can't set 'property', you can only append to the properties list, and I don't
see any clean way of doing that through __setattr__

By the way, the taxonomies list totally doesn't work in the Java code; it only
sees the last taxonomy that you added.  I'm working with upstream on this.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list