[Twisted-Python] regarding classes and functions in twisted.python.reflect

Glyph glyph at twistedmatrix.com
Thu Dec 29 18:14:09 EST 2011


On Dec 29, 2011, at 10:52 AM, L. Daniel Burr wrote:

> Hi moijes12,
> 
> 
> On Thu, 29 Dec 2011 06:30:04 -0600, moses dsouza <moijes12 at gmail.com>  
> wrote:
> 
>> Hi
>> 
>> I'm new to twisted. While was working on bug #5385 I noticed that classes
>> AccessorType, PropertyAccessor, Accessor and Summer were rarely used
>> elsewhere in the code. Similaryly many functions exists which are unused.
>> Do we need these functions and classes? I do understand that the purpose
>> t.python.reflect provides  "Standardized versions of various cool and/or
>> strange things that you can do with Python's reflection capabilities."   
>> but
>> I feel if we could remove things that we don't need we could make the  
>> code
>> base smaller and move towards making twisted more efficient.
>> 
> 
> How would removing this code make twisted more efficient?  Is the savings  
> in disk-space significant?  Also, just because there is code in  
> t.p.reflect that is not used within twisted itself does not mean that  
> applications written using twisted are not using that code.
> 
> I think, in general, everyone likes the notion of making a codebase  
> smaller, but you always have to measure the benefit and the risk of doing  
> so.
> 
> Have a good one,
> 
> L. Daniel Burr

Hi Moses,

I pretty much agree with everything Daniel said, but I want to make sure you take it at face value, and not as Twisted's excuse for never removing anything :).  If it's truly a bad idea to use these APIs in new code - for example, if there's a Python feature that does what they do better, available in all the versions of Python we support - then they should definitely be removed.  You should file 2 tickets: one for deprecation, and one for removal, according to <http://twistedmatrix.com/trac/wiki/CompatibilityPolicy>.  If there are no objections on the ticket, we can close the deprecation one now and the removal one in the next release.

Thanks,

-glyph


More information about the Twisted-Python mailing list