Python 3 consistency proposal

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Wed Mar 25 08:26:10 EDT 2009


Ben Finney a écrit :
> Steven D'Aprano <steven at REMOVE.THIS.cybersource.com.au> writes:
> 
>> If you *are* willing to do the work, the chances would still be
>> pretty slim. Guido has just rejected a patch adding PEP 8 compliant
>> aliases for types like datetime […] As Guido has quoted before, "A
>> foolish consistency is the hobgoblin of little minds".
> 
> Indeed, that quote is prominent in PEP 8 itself.
> 
> 
> gert <gert.cuykens at gmail.com> writes:
> 
>> Not that I can't live without, but I am just wondering why they did
>> not [name built-in types consistently with other classes] in the
>> first place?
> 
> Because, in the first place, built-in types were disjoint from
> user-defined classes. The latter could not derive from the former, and
> it was helpful to know the difference.
> 
> The reason no longer exists (since built-in types and user types are
> now in a unified hierarchy), but the difference is well entrenched now
> and I personally see little benefit in changing it.
> 

<mode="not a chance">
Also and FWIW, since there's no functional nor syntaxical differences 
between a call to a function returning an object and a call to a class, 
if we where to rename anything, it would be better to drop the MixedCase 
convention for classes and rename *all* types to all_lower. That way, 
you can safely rewrite a class as a factory function (or a factory 
function as a class) without having to choose between breaking the API 
or violating pep08 !-)
</mode>





More information about the Python-list mailing list