Hi all,

I'm writing Dolfin-compatible wrappers for PyOP2 as previously advertised
at FEniCS '13, which is causing me to bump into one of the "interesting"
quirks of the Python Dolfin API. Lots of things which would appear to
naturally be properties are actually methods and have to be called to be
accessed. For one among many, many examples, consider the value_size method
of a Function. This is accessed with:

f.value_size()

while

f.value_size

would seem more natural. Given the existence of the @property decorator in
standard Python which translates the former into the latter, this is
particularly mysterious. Is there a reason why this is done in Dolfin?

For PyOP2, many of these properties of classes really are properties in the
Python sense, so I find myself writing an awful lot of wrapper routines
just to achieve compatibility with Dolfin.

David

-- 
Dr David Ham
Department of Computing
Imperial College London

http://www.imperial.ac.uk/people/david.ham
_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics

Reply via email to