Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Python 3 consistency proposal

Reply
Thread Tools

Python 3 consistency proposal

 
 
gert
Guest
Posts: n/a
 
      03-24-2009
Rename all built in classes with a capital letter
example Str() Int() Object()

Make () optional for a function definition
class Test:
pass

def test:
pass

Any chance Guido would approve this
 
Reply With Quote
 
 
 
 
Daniel Fetchinson
Guest
Posts: n/a
 
      03-24-2009
> Rename all built in classes with a capital letter
> example Str() Int() Object()


Why?

> Make () optional for a function definition
> class Test:
> pass
>
> def test:
> pass


Why?

> Any chance Guido would approve this


In my estimation, the chance that Guido would approve this is less
than 10^(-26).

Cheers,
Daniel

--
Psss, psss, put it down! - http://www.cafepress.com/putitdown
 
Reply With Quote
 
 
 
 
Steven D'Aprano
Guest
Posts: n/a
 
      03-25-2009
On Tue, 24 Mar 2009 16:45:26 -0700, gert wrote:

> Rename all built in classes with a capital letter example Str() Int()
> Object()
>
> Make () optional for a function definition class Test:
> pass
>
> def test:
> pass
>
> Any chance Guido would approve this


Unless you're volunteering to produce a patch, the chances are zero.

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, so I think replacing built-ins have all-but zero
chance. But if you want to pursue it, the right place is the python-ideas
mailing list. Go for it ... but be prepared to justify the change, and
not just "for consistency". As Guido has quoted before, "A foolish
consistency is the hobgoblin of little minds".



--
Steven
 
Reply With Quote
 
gert
Guest
Posts: n/a
 
      03-25-2009
On Mar 25, 1:23*am, Steven D'Aprano
<(E-Mail Removed)> wrote:
> On Tue, 24 Mar 2009 16:45:26 -0700, gert wrote:
> > Rename all built in classes with a capital letter example Str() Int()
> > Object()

>
> > Make () optional for a function definition class Test:
> > * * pass

>
> > def test:
> > * * pass

>
> > Any chance Guido would approve this

>
> Unless you're volunteering to produce a patch, the chances are zero.
>
> 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, so I think replacing built-ins have all-but zero
> chance. But if you want to pursue it, the right place is the python-ideas
> mailing list. Go for it ... but be prepared to justify the change, and
> not just "for consistency". As Guido has quoted before, "A foolish
> consistency is the hobgoblin of little minds".


Its only foolish because it breaks everything, but it would not be
foolish on a syntax level.
Not that I can't live without, but I am just wondering why they did
not do this in the first place?

 
Reply With Quote
 
Terry Reedy
Guest
Posts: n/a
 
      03-25-2009
gert wrote:
> On Mar 25, 1:23 am, Steven D'Aprano
> <(E-Mail Removed)> wrote:
>> On Tue, 24 Mar 2009 16:45:26 -0700, gert wrote:
>>> Rename all built in classes with a capital letter example Str() Int()
>>> Object()
>>> Make () optional for a function definition class Test:
>>> pass
>>> def test:
>>> pass
>>> Any chance Guido would approve this

>> Unless you're volunteering to produce a patch, the chances are zero.


No. He just made clear today that he values stability over
non-functional consistency changes -- especially now that 3.0 is out.

>> 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, so I think replacing built-ins have all-but zero
>> chance. But if you want to pursue it, the right place is the python-ideas
>> mailing list. Go for it ... but be prepared to justify the change, and
>> not just "for consistency". As Guido has quoted before, "A foolish
>> consistency is the hobgoblin of little minds".

>
> Its only foolish because it breaks everything, but it would not be
> foolish on a syntax level.
> Not that I can't live without, but I am just wondering why they did
> not do this in the first place?


As I remember, int, str, etc, once *were* functions (or at best types)
rather than callable class objects. Before 2.2, built-in types and
user-defined classes were separate categories of entities.

tjr

 
Reply With Quote
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      03-25-2009
Ben Finney a écrit :
> Steven D'Aprano <(E-Mail Removed)> 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 <(E-Mail Removed)> 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>


 
Reply With Quote
 
Colin J. Williams
Guest
Posts: n/a
 
      03-25-2009
gert wrote:
> Rename all built in classes with a capital letter
> example Str() Int() Object()
>
> Make () optional for a function definition
> class Test:
> pass
>
> def test:
> pass
>
> Any chance Guido would approve this

Zero.

But I like the idea. Is version 3
really sacrosanct? I wonder how much
it's used so far.

Colin W.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Consistency in Python Hendrik van Rooyen Python 6 08-26-2006 08:52 AM
Maintain Consistency With ASP.NET Templates =?Utf-8?B?VkIgQ29kZXI=?= ASP .Net 1 02-13-2006 10:38 PM
Question about consistency in python language lechequier@gmail.com Python 22 09-11-2005 07:27 PM
Consistency? decius The Lounge 3 06-26-2005 05:28 PM



Advertisments