Re: The Python standard library and PEP8

2009-04-21 Thread Lawrence D'Oliveiro
In message , Steven D'Aprano wrote: > Everybody understands what you mean when you say something is tasty, even > though everyone's understanding of tasty is different. You don't need to > agree on what tasty *is* to agree that something *isn't* tasty But you do if you want to describe somethin

Re: The Python standard library and PEP8

2009-04-20 Thread Steven D'Aprano
On Mon, 20 Apr 2009 21:30:20 -0700, Aahz wrote: > In article > <37d39064-b73d-4e47-9e1e-d07c14bfc...@z8g2000prd.googlegroups.com>, > alex23 wrote: >>On Apr 21, 1:18 pm, Tim Wintle wrote: >>> >>> There was some suggestion about introducing synonyms that followed >>> PEP8 and introducing deprecat

Re: The Python standard library and PEP8

2009-04-20 Thread Aahz
In article <37d39064-b73d-4e47-9e1e-d07c14bfc...@z8g2000prd.googlegroups.com>, alex23 wrote: >On Apr 21, 1:18 pm, Tim Wintle wrote: >> >> There was some suggestion about introducing synonyms that followed PEP8 >> and introducing deprecation warnings as you suggested, but I can't >> remember the

Re: The Python standard library and PEP8

2009-04-20 Thread alex23
On Apr 21, 1:18 pm, Tim Wintle wrote: > There was some suggestion about introducing synonyms that followed PEP8 > and introducing deprecation warnings as you suggested, but I can't > remember the outcome. I'd suggest checking the dev archives. What about the possibility of offering an additional,

Re: The Python standard library and PEP8

2009-04-20 Thread Tim Wintle
On Sun, 2009-04-19 at 18:43 +0200, Emmanuel Surleau wrote: > Hi there, > > Exploring the Python standard library, I was surprised to see that several > packages (ConfigParser, logging...) use mixed case for methods all over the > place. I assume that they were written back when the Python stylin

Re: The Python standard library and PEP8

2009-04-20 Thread Steven D'Aprano
On Mon, 20 Apr 2009 06:18:17 -0700, Scott David Daniels wrote: > Steven D'Aprano wrote: >> ... There's an accepted definition for "objected oriented programming >> language": a language which provides "objects", which are constructs >> encapsulating both data and routines to operate on that data i

Re: The Python standard library and PEP8

2009-04-20 Thread Echo
On Mon, Apr 20, 2009 at 9:31 AM, George Sakkis wrote: > On Apr 19, 6:01 pm, "Martin P. Hellwig" > > > Besides, calling Python Object-Orientated is a bit of an insult :-). I > > would say that Python is Ego-Orientated, it allows me to do what I want. > > +1 QOTW > So true. +1 QOTW -- -Brandon S

Re: The Python standard library and PEP8

2009-04-20 Thread Emmanuel Surleau
On Monday 20 April 2009 10:55:19 Steven D'Aprano wrote: > On Mon, 20 Apr 2009 08:05:01 +0200, Emmanuel Surleau wrote: > > On Monday 20 April 2009 01:48:04 Steven D'Aprano wrote: > >> It also depends on whether you see the length of a data structure as a > >> property of the data, or the result of a

Re: The Python standard library and PEP8

2009-04-20 Thread Colin J. Williams
Emmanuel Surleau wrote: Hi there, Exploring the Python standard library, I was surprised to see that several packages (ConfigParser, logging...) use mixed case for methods all over the place. I assume that they were written back when the Python styling guidelines were not well-defined. Give

Re: The Python standard library and PEP8

2009-04-20 Thread Jeremiah Dodds
On Mon, Apr 20, 2009 at 2:18 PM, Scott David Daniels wrote: > Steven D'Aprano wrote: > >> ... There's an accepted definition for "objected oriented programming >> language": a language which provides "objects", which are constructs >> encapsulating both data and routines to operate on that data in

Re: The Python standard library and PEP8

2009-04-20 Thread George Sakkis
On Apr 19, 6:01 pm, "Martin P. Hellwig" > Besides, calling Python Object-Orientated is a bit of an insult :-). I > would say that Python is Ego-Orientated, it allows me to do what I want. +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: The Python standard library and PEP8

2009-04-20 Thread Scott David Daniels
Steven D'Aprano wrote: ... There's an accepted definition for "objected oriented programming language": a language which provides "objects", which are constructs encapsulating both data and routines to operate on that data in a single item. Says you. Roger King wrote a book entitled "My Cat is

Re: The Python standard library and PEP8

2009-04-20 Thread Aahz
In article , Steven D'Aprano wrote: >On Mon, 20 Apr 2009 03:44:59 -0400, Terry Reedy wrote: >> Steven D'Aprano wrote: >>> On Mon, 20 Apr 2009 19:18:23 +1200, Lawrence D'Oliveiro wrote: In message , Aahz wrote: > > What kind of OO language allows you to do this: > > def square

Re: The Python standard library and PEP8

2009-04-20 Thread Steven D'Aprano
On Mon, 20 Apr 2009 08:05:01 +0200, Emmanuel Surleau wrote: > On Monday 20 April 2009 01:48:04 Steven D'Aprano wrote: > >> It also depends on whether you see the length of a data structure as a >> property of the data, or the result of an operation ("counting") on the >> data structure. We often

Re: The Python standard library and PEP8

2009-04-20 Thread Steven D'Aprano
On Mon, 20 Apr 2009 19:15:51 +1200, Lawrence D'Oliveiro wrote: > In message , > Christian Heimes wrote: > >> Neither Java nor Python are pure object oriented languages. > > That's like saying the Soviet Union was never a pure communist country, > or that the US is not a pure capitalist country.

Re: The Python standard library and PEP8

2009-04-20 Thread Steven D'Aprano
On Mon, 20 Apr 2009 03:44:59 -0400, Terry Reedy wrote: > Steven D'Aprano wrote: >> On Mon, 20 Apr 2009 19:18:23 +1200, Lawrence D'Oliveiro wrote: >> >>> In message , Aahz wrote: >>> What kind of OO language allows you to do this: def square(x): return x*x for i i

Re: The Python standard library and PEP8

2009-04-20 Thread Terry Reedy
Steven D'Aprano wrote: On Mon, 20 Apr 2009 19:18:23 +1200, Lawrence D'Oliveiro wrote: In message , Aahz wrote: What kind of OO language allows you to do this: def square(x): return x*x for i in range(10): print square(x) Take out the "OO" qualifier, and the answer is still "none":

Re: The Python standard library and PEP8

2009-04-20 Thread Steven D'Aprano
On Mon, 20 Apr 2009 19:18:23 +1200, Lawrence D'Oliveiro wrote: > In message , Aahz wrote: > >> What kind of OO language allows you to do this: >> >> def square(x): >> return x*x >> >> for i in range(10): >> print square(x) > > Take out the "OO" qualifier, and the answer is still "none"

Re: The Python standard library and PEP8

2009-04-20 Thread Lawrence D'Oliveiro
In message , Aahz wrote: > What kind of OO language allows you to do this: > > def square(x): > return x*x > > for i in range(10): > print square(x) Take out the "OO" qualifier, and the answer is still "none": Traceback (most recent call last): File "", line 2, in NameEr

Re: The Python standard library and PEP8

2009-04-20 Thread Lawrence D'Oliveiro
In message , Christian Heimes wrote: > Neither Java nor Python are pure object oriented languages. That's like saying the Soviet Union was never a pure communist country, or that the US is not a pure capitalist country. "Pure", it seems, can be endlessly redefined to exclude any example you mi

Re: The Python standard library and PEP8

2009-04-19 Thread bearophileHUGS
Emmanuel Surleau: > On an unrelated note, it would be *really* nice to have a length property on > strings. Even Java has that! Once you have written a good amount of Python code you can understand that a len() function, that calls the __len__ method of objects, is better. It allows you to write:

Re: The Python standard library and PEP8

2009-04-19 Thread Stephen Hansen
> > Also, my code sample was itself a trick question. Python has *dynamic* > > object orientation (just as the blurb says), and square() will work > > on any object with a __mul__() method (through the ``*`` syntax), just as > > len() works on any object with a __len__() method. So my code > > d

Re: The Python standard library and PEP8

2009-04-19 Thread Emmanuel Surleau
> >Allowing for procedural-style programming does not mean that a language > >does not implement (even imperfectly) an OO paradigm. > > "Allowing" is the wrong term here. Python absolutely encourages a > straightforward procedural style when appropriate; unlike Java, there is > no attempt to forc

Re: The Python standard library and PEP8

2009-04-19 Thread Emmanuel Surleau
On Monday 20 April 2009 01:48:04 Steven D'Aprano wrote: > The problem is, I believe, that people wrongly imagine that there is One > True Way of a language being "object-oriented", and worse, that the OTW > is the way Java does it. (If it were Smalltalk, they'd at least be able > to make the argum

Re: The Python standard library and PEP8

2009-04-19 Thread Aahz
[BTW, please make sure to retain attributions for quotes] In article , Emmanuel Surleau wrote: >Aahz: >> >> What makes you think Python is "an OO language"? > >Python is a dynamic object-oriented programming language that can be used >for many kinds of software development. > >First line on th

Re: The Python standard library and PEP8

2009-04-19 Thread Steven D'Aprano
On Sun, 19 Apr 2009 13:46:23 -0700, Aahz wrote: > What makes you think Python is "an OO language"? The fact that everything in Python is an object is a good hint. > What kind of OO language allows you to do this: > > def square(x): > return x*x > > for i in range(10): > print square

Re: The Python standard library and PEP8

2009-04-19 Thread Dan Sommers
On Sun, 19 Apr 2009 18:43:10 +0200, Emmanuel Surleau wrote: > On an unrelated note, it would be *really* nice to have a length > property on strings. Even Java has that! And even in Java, they have sin(x) rather than x.sin(). Dan -- Dan Sommers A death spiral

Re: The Python standard library and PEP8

2009-04-19 Thread Martin P. Hellwig
Emmanuel Surleau wrote: What makes you think Python is "an OO language"? Python is a dynamic object-oriented programming language that can be used for many kinds of software development. First line on the Python official website. Was this a trick question? What kind of OO language allows y

Re: The Python standard library and PEP8

2009-04-19 Thread Emmanuel Surleau
> What makes you think Python is "an OO language"? Python is a dynamic object-oriented programming language that can be used for many kinds of software development. First line on the Python official website. Was this a trick question? > What kind of OO > language allows you to do this: > > def

Re: The Python standard library and PEP8

2009-04-19 Thread Emmanuel Surleau
On Sunday 19 April 2009 21:46:46 Christian Heimes wrote: > Emmanuel Surleau wrote: > > First off, it's pretty commonplace in OO languages. Secondly, given the > > number of methods available for the string objects, it is only natural to > > assume that dir("a") would show me a len() or length() or

Re: The Python standard library and PEP8

2009-04-19 Thread Emmanuel Surleau
> Perhaps in statically typed languages. Python is dynamic, so a x.length() > requires a method lookup and that's expensive. len(x) on the contrary, can > be optimized on a case by case basis -- it DOESN'T translate to > x.__len__() as some might think. > See > http://www.python.org/doc/faq/general

Re: The Python standard library and PEP8

2009-04-19 Thread Aahz
In article , Emmanuel Surleau wrote: >On Sunday 19 April 2009 19:37:59 Gabriel Genellina wrote: >> En Sun, 19 Apr 2009 13:43:10 -0300, Emmanuel Surleau >> escribi=F3: >>> >>> On an unrelated note, it would be *really* nice to have a length >>> property on strings. Even Java has that! >> >> Why

Re: The Python standard library and PEP8

2009-04-19 Thread Carl Banks
On Apr 19, 11:41 am, Emmanuel Surleau wrote: > First off, it's pretty commonplace in OO languages. Secondly, given the > number of methods available for the string objects, it is only natural to > assume that dir("a") would show me a len() or length() or size() method. > Having to use a function f

Re: The Python standard library and PEP8

2009-04-19 Thread Gabriel Genellina
En Sun, 19 Apr 2009 15:41:02 -0300, Emmanuel Surleau escribió: On Sunday 19 April 2009 19:37:59 Gabriel Genellina wrote: En Sun, 19 Apr 2009 13:43:10 -0300, Emmanuel Surleau > On an unrelated note, it would be *really* nice to have a length > property on > strings. Even Java has that! Wh

Re: The Python standard library and PEP8

2009-04-19 Thread Christian Heimes
Emmanuel Surleau wrote: > First off, it's pretty commonplace in OO languages. Secondly, given the > number of methods available for the string objects, it is only natural to > assume that dir("a") would show me a len() or length() or size() method. > Having to use a function for such a mundane o

Re: The Python standard library and PEP8

2009-04-19 Thread Emmanuel Surleau
On Sunday 19 April 2009 19:37:59 Gabriel Genellina wrote: > En Sun, 19 Apr 2009 13:43:10 -0300, Emmanuel Surleau > > escribió: > > Exploring the Python standard library, I was surprised to see that > > several > > packages (ConfigParser, logging...) use mixed case for methods all over > > the > >

Re: The Python standard library and PEP8

2009-04-19 Thread Gabriel Genellina
En Sun, 19 Apr 2009 14:52:23 -0300, Paul Hankin escribió: On Apr 19, 7:37 pm, "Gabriel Genellina" wrote: The threading module has such aliases, but there are no plans for mass   renaming all the stdlib that I know of. You'll have to live with this   inconsistency. It's been fixed in Pytho

Re: The Python standard library and PEP8

2009-04-19 Thread Paul Hankin
On Apr 19, 7:37 pm, "Gabriel Genellina" wrote: > The threading module has such aliases, but there are no plans for mass   > renaming all the stdlib that I know of. You'll have to live with this   > inconsistency. It's been fixed in Python 3.0! -- Paul Hankin -- http://mail.python.org/mailman/lis

Re: The Python standard library and PEP8

2009-04-19 Thread Gabriel Genellina
En Sun, 19 Apr 2009 13:43:10 -0300, Emmanuel Surleau escribió: Exploring the Python standard library, I was surprised to see that several packages (ConfigParser, logging...) use mixed case for methods all over the place. I assume that they were written back when the Python styling guideli

Re: The Python standard library and PEP8

2009-04-19 Thread Pascal Chambon
I agree that there are still some styling inconsistencies in python stdlib, but I'm not advocating a cleaning because I've always found camelCase much prettier than those multi_underscore_methods :p Concerning the length property of strings, isn't the __len__() method sufficient ? I know they'

The Python standard library and PEP8

2009-04-19 Thread Emmanuel Surleau
Hi there, Exploring the Python standard library, I was surprised to see that several packages (ConfigParser, logging...) use mixed case for methods all over the place. I assume that they were written back when the Python styling guidelines were not well-defined. Given that it's rather irritati