Re: Python 3 consistency proposal

2009-03-25 Thread Bruno Desthuilliers

Ben Finney a écrit :

Steven D'Aprano ste...@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.cuyk...@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


--
http://mail.python.org/mailman/listinfo/python-list


Re: Python 3 consistency proposal

2009-03-25 Thread Colin J. Williams

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.
--
http://mail.python.org/mailman/listinfo/python-list


Python 3 consistency proposal

2009-03-24 Thread gert
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 :-)
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python 3 consistency proposal

2009-03-24 Thread Daniel Fetchinson
 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
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python 3 consistency proposal

2009-03-24 Thread Steven D'Aprano
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
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python 3 consistency proposal

2009-03-24 Thread gert
On Mar 25, 1:23 am, Steven D'Aprano
ste...@remove.this.cybersource.com.au 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?

--
http://mail.python.org/mailman/listinfo/python-list


Re: Python 3 consistency proposal

2009-03-24 Thread Ben Finney
Steven D'Aprano ste...@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.cuyk...@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.

-- 
 \“The number of UNIX installations has grown to 10, with more |
  `\ expected.” —Unix Programmer's Manual, 2nd Ed., 1972-06-12 |
_o__)  |
Ben Finney

--
http://mail.python.org/mailman/listinfo/python-list


Re: Python 3 consistency proposal

2009-03-24 Thread Terry Reedy

gert wrote:

On Mar 25, 1:23 am, Steven D'Aprano
ste...@remove.this.cybersource.com.au 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

--
http://mail.python.org/mailman/listinfo/python-list