[Twisted-Python] Re: [Twisted-commits] r22428 - Deprecation API for functions and methods.

glyph at divmod.com glyph at divmod.com
Thu Jan 31 12:01:48 EST 2008

On 04:23 pm, exarkun at divmod.com wrote:
>Maybe Version shouldn't be responsible for any view at all.  Maybe 
>is just a model class, and things that actually know what the view
>requirements are can implement the view?

I agree insofar as the model is poorly exposed and documented.  The 
ivars have no documentation, and the only way to get the SVN revision is 
to call a private method or to mangle strings.

However, some of these "views" should definitely be attached to the 
class, for convenience and simplicity.  For example, a sensible __repr__ 
makes debugging and inspecting these things a lot easier.  Adding a new 
module, function, or class which does the string formatting means that 
users of Version will need to look somewhere else to perform the 
function they want, and ultimately it doesn't eliminate the confusion - 
"do I want the 'short dotted' view or the 'includes project but without 
development version' view?" - unless we also reduce the number of 
options available.

More information about the Twisted-Python mailing list