
Hi, I am planning on contributing some changes to measure.regionprops, mainly for reducing memory usage. I have noticed a couple of really odd things with respect to coding style in this code. I am tempted to just refactor this to a more conventional style in the course of making my changes, but it looks like someone went to quite some trouble to do it this way, so I thought I would ask here first in case there is some reason for doing it like this. Firstly, the way the methods are made into property methods (i.e. what would normally be simply declared with the @property decorator) is strange. This is currently done by running through the class dir and adding the properties; more strangely the code to do this is burred in a method which also programmatically re-factors the doc strings. This method is set to run only when __debug__ is defined, which means that if python happens to be run with the -O flag, then any code which uses regionprops in the conventional manner (including all unit tests) will fail in a very confusing way. The doc string thing is also strange. All the methods in the _RegionProperties class don't actually have docstrings. The actual attribute documentation is instead in some notes inside the regionprops function. The docstring for this is programmatically pasted into the appropriate __doc__ attributes on module import with a complicated regex. -- Richard