Python 3 consistency proposal

Discussion in 'Python' started by gert, Mar 24, 2009.

  1. gert

    gert Guest

    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 :)
    gert, Mar 24, 2009
    #1
    1. Advertising

  2. > 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
    Daniel Fetchinson, Mar 24, 2009
    #2
    1. Advertising

  3. 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
    Steven D'Aprano, Mar 25, 2009
    #3
  4. gert

    gert Guest

    On Mar 25, 1:23 am, Steven D'Aprano
    <> 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?
    gert, Mar 25, 2009
    #4
  5. gert

    Terry Reedy Guest

    gert wrote:
    > On Mar 25, 1:23 am, Steven D'Aprano
    > <> 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
    Terry Reedy, Mar 25, 2009
    #5
  6. Ben Finney a écrit :
    > Steven D'Aprano <> 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 <> 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>
    Bruno Desthuilliers, Mar 25, 2009
    #6
  7. 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.
    Colin J. Williams, Mar 25, 2009
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VkIgQ29kZXI=?=

    Maintain Consistency With ASP.NET Templates

    =?Utf-8?B?VkIgQ29kZXI=?=, Apr 18, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    432
    aruntjose
    Feb 13, 2006
  2. Replies:
    1
    Views:
    1,996
    slareau
    Nov 17, 2006
  3. Replies:
    0
    Views:
    402
  4. Replies:
    22
    Views:
    564
    Terry Reedy
    Sep 11, 2005
  5. Hendrik van Rooyen

    Consistency in Python

    Hendrik van Rooyen, Aug 25, 2006, in forum: Python
    Replies:
    6
    Views:
    337
    Hendrik van Rooyen
    Aug 26, 2006
Loading...

Share This Page