[Python-3000] renaming suggestion

Fred Drake fdrake at acm.org
Wed Aug 1 13:54:56 CEST 2007


On Aug 1, 2007, at 12:55 AM, hashcollision wrote:
> I think that WeakKeyDictionary and should be renamed to WeakKeyDict  
> (same with WeakValueDictionary). This will make it consistent with  
> dict and collections.defaultdict.

Hmm.  I'm not opposed to providing new names for these classes if  
that really helps, though I'm not convinced that it does.  The old  
names should be preserved for backward compatibility.

If we're looking for some sort of consistency, it seems that having  
both CamelCase and righteouscase doesn't help.  There's precedent for  
both, but the general trend seems to be toward CamelCase for classes  
that aren't built-in.  (The use of a C implementation for defaultdict  
isn't a consideration, IMO.)

Would you consider weakkeydict and weakvaluedict better than  
WeakKeyDict and WeakValueDict?  If not, I suspect that consistency  
isn't the underlying motivation.


   -Fred

-- 
Fred Drake   <fdrake at acm.org>





More information about the Python-3000 mailing list