Re: [Python-Dev] Is object the most base type? (bpo-20285)

2018-02-02 Thread Terry Reedy

On 2/2/2018 1:53 AM, Terry Reedy wrote:

 >>> object.__doc__
'The most base type'

I and several people on python-list thread "interactive help on the base 
object" (Dec   2013) thought this could be improved.  On

https://bugs.python.org/issue20285 and
https://github.com/python/cpython/pull/4759

After some research, I believe the following, which is wrote on the 
issue, explains the uneasiness many feel.


'Base' is actually two words.  As a noun (or verb), it comes from 
Ancient Greek βάσις (básis), a foundation from which other things extend 
or derive.  As an adjective, it comes from Late Latin bassus (“low”).


In computer science and Python, the couplet 'base class' is being used, 
it seems to me and apparently others, as a noun-noun compound, meaning, 
'foundation class', not as an adjective-noun phrase meaning 'low class' 
(let along 'depraved class').  However, 'most base class' must be parsed 
as '(most base) class', with 'base' re-interpreted as the adjective 
meaning 'low' (or worse).  The switch in meaning of 'base' is similar in 
'baseball' versus  'most base ball'.

---

I have suggested
"The superclass for all Python classes."
"The starting base class of all types and classes other than itself."


"a base for all classes." object entry in lib ref, function
"the ultimate base class of all other classes."  Martin Panter

object is neither a base or superclass of itself, so the first of each 
pair above is not quite right.


"the base class of the class heirarchy ['hierarchy']"  Steven D'Aprano
"the root of the class heirarchy"  ditto
+ quotes from Java and Ruby

Jeff Allen and Barry Warsaw like either, with BW slightly referring the 
first.


I was thinking about 'tree' instead of 'hierachy', but 'class tree' is 
wrong and 'directed acyclic graph of classes' a bit wordy.  While 
hierarchies are often thought of as trees, it is possible for someone to 
report to more than one person.


No one (yet) supported the status quo.

Martin also suggested a continuation:  "When called, it accepts no
arguments and returns a new unique and featureless object."

Even though object, unlike any other class, is primarily used as a base 
class rather than instance source, the latter should be included.  For 
other built-in classes, the summary line describes instances. I would 
leave out 'unique' as that could be confused with 'singleton'.


Provisional replacement, following the format of other class docstrings 
except for describing the class instead of instances, and intended to be 
helpful to beginners.


"The base class of the class hierarchy.

When called, it accepts no arguments and returns a new featureless 
instance that has no instance attributes and cannot be given any."


Passing arguments and adding attributes are two common mistakes.


--
Terry Jan Reedy


___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Is object the most base type? (bpo-20285)

2018-02-02 Thread Jeff Allen


On 02/02/2018 07:25, Steven D'Aprano wrote:

How about:
"the base class of the class heirarchy"

"the root of the class heirarchy"


Java ... now says:

 "Class Object is the root of the class hierarchy. Every class has
 Object as a superclass. All objects, including arrays, implement the
 methods of this class."


Either for me, but I feel I should draw attention to the spelling. (Java 
is right.)


Ironically, the word derives from priesthood (hieratic), not from 
inheritance (heir).


Jeff Allen

___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Is object the most base type? (bpo-20285)

2018-02-02 Thread Barry Warsaw
On Feb 2, 2018, at 02:25, Steven D'Aprano  wrote:
> 
> On Fri, Feb 02, 2018 at 01:53:00AM -0500, Terry Reedy wrote:
> object.__doc__
>> 'The most base type’

Clearly that’s a typo.  It should be: “The most bass type” as in: "It all 
starts with the bass, the most important part of any band or class hierarchy.  
Sure, the drums type is very important, and the bass type and drums type work 
hand-in-hand to provide you with a solid funky foundation on which to groove, 
er, code.  Don’t let those guitar types tell you anything else."

> "the base class of the class heirarchy"
> 
> "the root of the class heirarchy"

In all seriousness, either one of those works for me.  While the first one does 
repeat the word “class”, it seems the most clear description of what this thing 
is.

-Barry



signature.asc
Description: Message signed with OpenPGP
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Is object the most base type? (bpo-20285)

2018-02-02 Thread Martin Panter
> On Fri, Feb 02, 2018 at 01:53:00AM -0500, Terry Reedy wrote:
>> >>> object.__doc__
>> 'The most base type'
> [...]
>> I have suggested
>> "The superclass for all Python classes."
>> "The starting base class of all types and classes other than itself."
>>
>> I intended to pick the second, but Serhiy Storchake wants more opinions.

On 2 February 2018 at 07:25, Steven D'Aprano  wrote:
> "the base class of the class heirarchy"
>
> "the root of the class heirarchy"

The RST documentation

says

Object is a base for all classes.

which is better than “the most base type” IMO, although I would write
_the_ base rather than _a_ base; there is only one object class. In my
patch for the RST documentation in
 I proposed

This is the ultimate base class of all other classes.

which I still think is okay (though other parts of my patch doesn’t
seem very good).
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Is object the most base type? (bpo-20285)

2018-02-01 Thread Steven D'Aprano
On Fri, Feb 02, 2018 at 01:53:00AM -0500, Terry Reedy wrote:
> >>> object.__doc__
> 'The most base type'
[...]
> I have suggested
> "The superclass for all Python classes."
> "The starting base class of all types and classes other than itself."
> 
> I intended to pick the second, but Serhiy Storchake wants more opinions.

Yay, bike-shedding!

How about:

"the base class of the class heirarchy"

"the root of the class heirarchy"


Java used to say this about Object:

"The root class of the Java class hierarchy. All non-primitive types 
(including arrays) inherit either directly or indirectly from this
class."

but now says:

"Class Object is the root of the class hierarchy. Every class has 
Object as a superclass. All objects, including arrays, implement the 
methods of this class."

https://developer.android.com/reference/java/lang/Object.html


Ruby says this about Object and BasicObject:

"Object is the default root of all Ruby objects. Object inherits 
from BasicObject which allows creating alternate object 
hierarchies."

"BasicObject is the parent class of all classes in Ruby. It's an 
explicit blank class."

https://ruby-doc.org/core-2.5.0/Object.html
https://ruby-doc.org/core-2.5.0/BasicObject.html


The root of Julia's object heirarchy is Any, but if it is documented 
anywhere, I can't find it. The interactive help just says:

Any
No documentation found.
Summary:
abstract Any <: Any




-- 
Steve
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Is object the most base type? (bpo-20285)

2018-02-01 Thread Terry Reedy

>>> object.__doc__
'The most base type'

I and several people on python-list thread "interactive help on the base 
object" (Dec   2013) thought this could be improved.  On

https://bugs.python.org/issue20285 and
https://github.com/python/cpython/pull/4759

After some research, I believe the following, which is wrote on the 
issue, explains the uneasiness many feel.


'Base' is actually two words.  As a noun (or verb), it comes from 
Ancient Greek βάσις (básis), a foundation from which other things extend 
or derive.  As an adjective, it comes from Late Latin bassus (“low”).


In computer science and Python, the couplet 'base class' is being used, 
it seems to me and apparently others, as a noun-noun compound, meaning, 
'foundation class', not as an adjective-noun phrase meaning 'low class' 
(let along 'depraved class').  However, 'most base class' must be parsed 
as '(most base) class', with 'base' re-interpreted as the adjective 
meaning 'low' (or worse).  The switch in meaning of 'base' is similar in 
'baseball' versus  'most base ball'.

---

I have suggested
"The superclass for all Python classes."
"The starting base class of all types and classes other than itself."

I intended to pick the second, but Serhiy Storchake wants more opinions.

--
Terry Jan Reedy


___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com