Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #61172 > unrolled thread

interactive help on the base object

Started byMark Lawrence <breamoreboy@yahoo.co.uk>
First post2013-12-06 17:03 +0000
Last post2013-12-08 07:11 -0500
Articles 20 on this page of 26 — 11 participants

Back to article view | Back to comp.lang.python


Contents

  interactive help on the base object Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-06 17:03 +0000
    Re: interactive help on the base object Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-08 13:10 +1300
      Re: interactive help on the base object Ned Batchelder <ned@nedbatchelder.com> - 2013-12-07 19:59 -0500
      Re: interactive help on the base object Mark Janssen <dreamingforward@gmail.com> - 2013-12-07 20:21 -0800
        Re: interactive help on the base object Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-12-08 10:33 +0000
          Re: interactive help on the base object Mark Janssen <dreamingforward@gmail.com> - 2013-12-08 15:01 -0800
            Re: interactive help on the base object Steven D'Aprano <steve@pearwood.info> - 2013-12-09 05:11 +0000
              Re: interactive help on the base object Ned Batchelder <ned@nedbatchelder.com> - 2013-12-09 05:59 -0500
                Re: interactive help on the base object Steven D'Aprano <steve@pearwood.info> - 2013-12-10 03:19 +0000
                  Re: interactive help on the base object rusi <rustompmody@gmail.com> - 2013-12-09 20:32 -0800
                    Re: interactive help on the base object Steven D'Aprano <steve@pearwood.info> - 2013-12-10 05:10 +0000
                      Re: interactive help on the base object rusi <rustompmody@gmail.com> - 2013-12-09 21:16 -0800
                        Re: interactive help on the base object Roy Smith <roy@panix.com> - 2013-12-10 00:31 -0500
                          Re: interactive help on the base object Steven D'Aprano <steve@pearwood.info> - 2013-12-10 06:05 +0000
                            Re: interactive help on the base object Roy Smith <roy@panix.com> - 2013-12-10 01:20 -0500
                        Re: interactive help on the base object Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-10 09:37 +0000
                          Re: interactive help on the base object rusi <rustompmody@gmail.com> - 2013-12-10 03:51 -0800
                          Re: interactive help on the base object alex23 <wuwei23@gmail.com> - 2013-12-11 12:04 +1000
                  Re: interactive help on the base object Ian Kelly <ian.g.kelly@gmail.com> - 2013-12-10 04:35 -0700
          Re: interactive help on the base object Chris Angelico <rosuav@gmail.com> - 2013-12-09 13:44 +1100
          Re: interactive help on the base object Mark Janssen <dreamingforward@gmail.com> - 2013-12-08 19:05 -0800
          Re: interactive help on the base object Chris Angelico <rosuav@gmail.com> - 2013-12-09 14:17 +1100
          Re: interactive help on the base object Ian Kelly <ian.g.kelly@gmail.com> - 2013-12-09 03:12 -0700
          Re: interactive help on the base object Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-09 15:06 +0000
        Re: interactive help on the base object Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-09 12:15 +1300
      Re: interactive help on the base object Ned Batchelder <ned@nedbatchelder.com> - 2013-12-08 07:11 -0500

Page 1 of 2  [1] 2  Next page →


#61172 — interactive help on the base object

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2013-12-06 17:03 +0000
Subjectinteractive help on the base object
Message-ID<mailman.3658.1386349412.18130.python-list@python.org>
Is it just me, or is this basically useless?

 >>> help(object)
Help on class object in module builtins:

class object
  |  The most base type

 >>>

Surely a few more words, or a pointer to this 
http://docs.python.org/3/library/functions.html#object, would be better?

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

[toc] | [next] | [standalone]


#61258

FromGregory Ewing <greg.ewing@canterbury.ac.nz>
Date2013-12-08 13:10 +1300
Message-ID<bghrnvFnpkpU1@mid.individual.net>
In reply to#61172
Mark Lawrence wrote:
> Is it just me, or is this basically useless?
> 
> class object
>  |  The most base type

It's also a somewhat strange construction from an English language
point of view. To make sense, it requires interpreting the word
"base" as an adjective, and when used that way it has connotations
of something to turn your nose up at. I'm assuming that's not the
impression we want to give!

Maybe something like "The ultimate base class of all classes"
would be better.

-- 
Greg

[toc] | [prev] | [next] | [standalone]


#61262

FromNed Batchelder <ned@nedbatchelder.com>
Date2013-12-07 19:59 -0500
Message-ID<mailman.3711.1386464378.18130.python-list@python.org>
In reply to#61258
On 12/7/13 7:10 PM, Gregory Ewing wrote:
> Mark Lawrence wrote:
>> Is it just me, or is this basically useless?
>>
>> class object
>>  |  The most base type
>
> It's also a somewhat strange construction from an English language
> point of view. To make sense, it requires interpreting the word
> "base" as an adjective, and when used that way it has connotations
> of something to turn your nose up at. I'm assuming that's not the
> impression we want to give!
>
> Maybe something like "The ultimate base class of all classes"
> would be better.
>

I've heard this described as "the root of the class hierarchy."

-- 
Ned Batchelder, http://nedbatchelder.com

[toc] | [prev] | [next] | [standalone]


#61270

FromMark Janssen <dreamingforward@gmail.com>
Date2013-12-07 20:21 -0800
Message-ID<mailman.3717.1386476467.18130.python-list@python.org>
In reply to#61258
>>> Is it just me, or is this basically useless?
>>>
>>> class object
>>>  |  The most *base* type
>>
[[Terry Reedy:]]
> How about something like.
> The default top *superclass* for all Python classes.

How 'bout you foo<l>s just admit that you didn't realize you've been
confused this whole time?  (It *is* possible isn't it?)

Mr. Ewing says "base" has to be interpreted as an *adjective* because
otherwise it would mean the BOTTOM (like the BASE of the pyramid),
while Terry responds that it is the TOP (*super*class).  Earlier,
Steven D'Aprano wanted to argue that this distinction was irrelevant,
but obviously it can't very well be both at once now cannit?

Could-the-world-be-so-crazy-confused-and-then-shoot-the-messenger?

Sadly, yes.

MarkJ
Tacoma, Washington

[toc] | [prev] | [next] | [standalone]


#61284

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2013-12-08 10:33 +0000
Message-ID<52a44afc$0$30003$c3e8da3$5496439d@news.astraweb.com>
In reply to#61270
On Sat, 07 Dec 2013 20:21:06 -0800, Mark Janssen wrote:

>>>> Is it just me, or is this basically useless?
>>>>
>>>> class object
>>>>  |  The most *base* type
>>>
> [[Terry Reedy:]]
>> How about something like.
>> The default top *superclass* for all Python classes.
> 
> How 'bout you foo<l>s just admit that you didn't realize you've been
> confused this whole time?  (It *is* possible isn't it?)
>
> Mr. Ewing says "base" has to be interpreted as an *adjective* because
> otherwise it would mean the BOTTOM (like the BASE of the pyramid), while
> Terry responds that it is the TOP (*super*class).  Earlier, Steven
> D'Aprano wanted to argue that this distinction was irrelevant, 

What are you talking about? Until this very post, I haven't made any 
comments in this thread. 


> but obviously it can't very well be both at once now cannit?

Of course it can. To people in the southern hemisphere, the South Pole is 
at the top of the world and the North Pole is at the bottom. For people 
in the northern hemisphere, it's the opposite, with the North Pole being 
"up" and the South Pole being "down".

http://cdn.shopify.com/s/files/1/0071/5032/products/upside_down_world_map.png


Family trees and other hierarchies, including class inheritance diagrams, 
have a *relative* direction not an absolute direction. We can all agree 
that Fred and Wilma are the parents of Pebbles, but it doesn't really 
matter whether we draw the family tree like this:


Fred      Wilma              (diagrams best viewed in a fixed-width font
  |         |                 like Courier, Monaco or Lucinda Typewriter)
  +----+----+
       |
    Pebbles


(inheritance goes *down* the page from ancestors to descendants)

or like this:

    Pebbles
       |
  +----+----+
  |         |
Fred      Wilma


(inheritance goes *up* the page from ancestors to descendants).

What matters is the relationships between the entities, not the specific 
direction they are drawn in relative to some imaginary absolute space. 
Likewise it doesn't matter whether we draw class hierarchies from the top 
down or the bottom up or even sidewise:

object --> int --> myint

is the same as:

myint <-- int <-- object


Ironically, although it is conventional to draw the most distant ancestor 
at the *top* of the page, it is called the *base* or *root* of the tree.


This Way Up
    ||
    ||
    ||
  \ || /
   \||/





-- 
Steven

[toc] | [prev] | [next] | [standalone]


#61332

FromMark Janssen <dreamingforward@gmail.com>
Date2013-12-08 15:01 -0800
Message-ID<mailman.3747.1386543721.18130.python-list@python.org>
In reply to#61284
On Sun, Dec 8, 2013 at 2:33 AM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> On Sat, 07 Dec 2013 20:21:06 -0800, Mark Janssen wrote:
>
>>>>> Is it just me, or is this basically useless?
>>>>>
>>>>> class object
>>>>>  |  The most *base* type
>>>>
>> [[Terry Reedy:]]
>>> How about something like.
>>> The default top *superclass* for all Python classes.
>>
>> How 'bout you foo<l>s just admit that you didn't realize you've been
>> confused this whole time?  (It *is* possible isn't it?)
>>
>> Mr. Ewing says "base" has to be interpreted as an *adjective* because
>> otherwise it would mean the BOTTOM (like the BASE of the pyramid), while
>> Terry responds that it is the TOP (*super*class).  Earlier, Steven
>> D'Aprano wanted to argue that this distinction was irrelevant,
>
> What are you talking about? Until this very post, I haven't made any
> comments in this thread.

It was a few months ago.  You do know what I'm talking about because
you just expounded with the exact same argument below.  It's like a
broken record.  (Now if *I* sound like a broken record, it's because
no seems to see the obvious, but carry on.)

>> but obviously it can't very well be both at once now cannit?
>
> Family trees and other hierarchies, including class inheritance diagrams,
> have a *relative* direction not an absolute direction. We can all agree
> that Fred and Wilma are the parents of Pebbles, but it doesn't really
> matter whether we draw the family tree like this:
>
>
> Fred      Wilma              (diagrams best viewed in a fixed-width font
>   |         |                 like Courier, Monaco or Lucinda Typewriter)
>   +----+----+
>        |
>     Pebbles
>
>
> (inheritance goes *down* the page from ancestors to descendants)
>
> or like this:
>
>     Pebbles
>        |
>   +----+----+
>   |         |
> Fred      Wilma
>
>
> (inheritance goes *up* the page from ancestors to descendants).
>
> What matters is the relationships between the entities, not the specific
> direction they are drawn in relative to some imaginary absolute space.
> [yadda, yagni, yadda]

But, there IS A DIFFERENCE.  Let me explain the concept of a object
model (or "type model" if you prefer).

In a family inheritance tree,  there is this difference -- called the
"calendar" --  which imposes an ordering which can't be countermanded
by flipping your silly chart around.  You made a bullshit example to
simply argue a point and *fooled yourself* into ignoring this.  Yes?

Likewise, WITH A COMPUTER, there is a definite order which can't be
countermanded by simply having this artifice called "Object".  If you
FEE(L)s hadn't noticed (no longer using the insult "foo"s out of
respect for the sensativities of the brogrammers), this artifice has
just been *called on the floor* with this little innocent question
that fired up this discussion again (don't hate the messenger).
Again:  people entering the community are pointing out a problem --
that Object is both trying to be the BASE and the SUPERclass of all
objects.

CS554: A type/object *model* has to define the relationship of these
nice abstractions so that they can be mapped to the *actual
concreteness* of the machine.  And there, bro, there is an ordering.
You're not going to magically flip the hierarchy so that your bitless
Object becomes a machine word that is the base of all your types.
You've been fooled by the magic of the Turing Machine.   The modern
computer mollifies you with the illusion of "total abstraction" where
there are no bits or 1s and 0s involved, but yea, it did not turn out
that way.  (Note bene: as a comparison, C++ is very UNAMBIGUOUS about
this fact -- all objects inherit from concrete machine types, which is
why it remains important, *despite* being one of the worst to do OOP
in.  Its *type model* is probably the most clear of any
object-oriented language).

> Likewise it doesn't matter whether we draw class hierarchies from the top
> down or the bottom up or even sidewise:

Have you caught it by now, friends:  IT MATTERS TO THE COMPUTER.
With some apologies for Ned for attempting to be neutral.   Apparently
you guys are philosophers more than Computer Engineers.

MarkJ
Tacoma, Washington

[toc] | [prev] | [next] | [standalone]


#61360

FromSteven D'Aprano <steve@pearwood.info>
Date2013-12-09 05:11 +0000
Message-ID<52a5511d$0$2762$c3e8da3$76491128@news.astraweb.com>
In reply to#61332
On Sun, 08 Dec 2013 15:01:59 -0800, Mark Janssen wrote:

> On Sun, Dec 8, 2013 at 2:33 AM, Steven D'Aprano
> <steve+comp.lang.python@pearwood.info> wrote:
>> On Sat, 07 Dec 2013 20:21:06 -0800, Mark Janssen wrote:
>>
>>>>>> Is it just me, or is this basically useless?
>>>>>>
>>>>>> class object
>>>>>>  |  The most *base* type
>>>>>
>>> [[Terry Reedy:]]
>>>> How about something like.
>>>> The default top *superclass* for all Python classes.
>>>
>>> How 'bout you foo<l>s just admit that you didn't realize you've been
>>> confused this whole time?  (It *is* possible isn't it?)
>>>
>>> Mr. Ewing says "base" has to be interpreted as an *adjective* because
>>> otherwise it would mean the BOTTOM (like the BASE of the pyramid),
>>> while Terry responds that it is the TOP (*super*class).  Earlier,
>>> Steven D'Aprano wanted to argue that this distinction was irrelevant,
>>
>> What are you talking about? Until this very post, I haven't made any
>> comments in this thread.
> 
> It was a few months ago.  You do know what I'm talking about because you
> just expounded with the exact same argument below.  It's like a broken
> record.

While I am gratified that you apparently memorise and obsess over things 
I wrote months ago, I'm sorry to tell you that I wasn't lying when I said 
that I didn't know what you were talking about. I had no idea that you 
were referring to a completely different conversation, nor do I recall 
every post I write here.

If I repeated the same argument, it is because the argument is still 
valid. Drawing the root of the tree at the top of the page is just a 
convention, just driving on the left side of the road, or calling the 
elected head of state "Prime Minister". There are other ways to do such 
things which are equally valid, and so long as both parties agree on the 
convention, it doesn't matter whether you write from left-to-right like 
in Australia, right-to-left like in Egypt, or alternate like in Israel.


> (Now if *I* sound like a broken record, it's because no seems
> to see the obvious, but carry on.)

It must be such a trial to be the only sane man in a world gone mad.


[...]
>> What matters is the relationships between the entities, not the
>> specific direction they are drawn in relative to some imaginary
>> absolute space. [yadda, yagni, yadda]
> 
> But, there IS A DIFFERENCE.  Let me explain the concept of a object
> model (or "type model" if you prefer).
> 
> In a family inheritance tree,  there is this difference -- called the
> "calendar" --  which imposes an ordering which can't be countermanded by
> flipping your silly chart around.  You made a bullshit example to simply
> argue a point and *fooled yourself* into ignoring this.  Yes?

No. You haven't explained anything, you have merely made an assertion 
with no supporting evidence at all.

In a family tree of ancestors and descendants, the relationship being 
draw is time-based. Ancestors exist before descendants. Descendants are 
derived in some way from ancestors, not the other way around. We all 
agree that your father existed before you. The temporal direction of the 
relationship is absolutely fixed, past before present, ancestors before 
descendants. We can agree on this.

Explain to me this: what (apart from mere human convention) imposes the 
ordering "past must be at the top of the page"?

If you are reading this as email, your mail client very likely has an 
option to sort message in order that they were received, either most-
recent at the top or oldest at the top. Do you really mean to imply that 
one of those is logical and the other is delusional?


> Likewise, WITH A COMPUTER, there is a definite order which can't be
> countermanded by simply having this artifice called "Object". If you
> FEE(L)s hadn't noticed (no longer using the insult "foo"s out of respect
> for the sensativities of the brogrammers), this artifice has just been
> *called on the floor* with this little innocent question that fired up
> this discussion again (don't hate the messenger). Again:  people
> entering the community are pointing out a problem -- that Object is both
> trying to be the BASE and the SUPERclass of all objects.

How is this a problem? They mean the same thing.

A television is both an appliance and a device. object is both the base 
class and a superclass of all other classes.


> CS554: A type/object *model* has to define the relationship of these
> nice abstractions so that they can be mapped to the *actual
> concreteness* of the machine.  And there, bro, there is an ordering.

Yes, the ordering is that the subclass is derived from the superclass. 
Nobody disputes that. But we can show that relationship using any 
convention we like:


superclass -> subclass 

subclass <- superclass 

"superclass extended by subclass"

"subclass extends superclass"

superclass
   ↓
subclass


subclass
   ↑
superclass


Python syntax:
    class MySubclass(MySuperclass): ...


Smalltalk syntax:
    MySuperclass :subclass #MySubclass


Java syntax:
    class MySubclass extends MySuperclass {...}



> You're not going to magically flip the hierarchy so that your bitless
> Object becomes a machine word that is the base of all your types.

You seem to be labouring under the delusion that inheritance, which is a 
high-level concept which only applies to objects, goes "all the way down" 
to low-level concepts like words and bits.

Objects do not *inherit* from bits. They are *composed* of bits.


> You've
> been fooled by the magic of the Turing Machine.   The modern computer
> mollifies you with the illusion of "total abstraction" where there are
> no bits or 1s and 0s involved, but yea, it did not turn out that way. 
> (Note bene: as a comparison, C++ is very UNAMBIGUOUS about this fact --
> all objects inherit from concrete machine types, which is why it remains
> important, *despite* being one of the worst to do OOP in.  Its *type
> model* is probably the most clear of any object-oriented language).

You haven't actually programmed in C++ have you?

There's no shame in answering that you haven't. I've never programmed in 
C++. It's on my to-do list, after giving myself an appendectomy with a 
dull rusty knife and just ahead of buying the complete collection of 
Justin Bieber albums. But even I know that you cannot inherit from native 
types, on account that they aren't objects.


>> Likewise it doesn't matter whether we draw class hierarchies from the
>> top down or the bottom up or even sidewise:
> 
> Have you caught it by now, friends:  IT MATTERS TO THE COMPUTER.

How the hell does the computer know which way I draw my class diagrams?



-- 
Steven

[toc] | [prev] | [next] | [standalone]


#61378

FromNed Batchelder <ned@nedbatchelder.com>
Date2013-12-09 05:59 -0500
Message-ID<mailman.3771.1386586782.18130.python-list@python.org>
In reply to#61360
On 12/9/13 12:11 AM, Steven D'Aprano wrote:
> On Sun, 08 Dec 2013 15:01:59 -0800, Mark Janssen wrote:
>
>> On Sun, Dec 8, 2013 at 2:33 AM, Steven D'Aprano
>> <steve+comp.lang.python@pearwood.info> wrote:
>>> On Sat, 07 Dec 2013 20:21:06 -0800, Mark Janssen wrote:
>>>
>>>>>>> Is it just me, or is this basically useless?
>>>>>>>
>>>>>>> class object
>>>>>>>   |  The most *base* type
>>>>>>
>>>> [[Terry Reedy:]]
>>>>> How about something like.
>>>>> The default top *superclass* for all Python classes.
>>>>
>>>> How 'bout you foo<l>s just admit that you didn't realize you've been
>>>> confused this whole time?  (It *is* possible isn't it?)
>>>>
>>>> Mr. Ewing says "base" has to be interpreted as an *adjective* because
>>>> otherwise it would mean the BOTTOM (like the BASE of the pyramid),
>>>> while Terry responds that it is the TOP (*super*class).  Earlier,
>>>> Steven D'Aprano wanted to argue that this distinction was irrelevant,
>>>
>>> What are you talking about? Until this very post, I haven't made any
>>> comments in this thread.
>>
>> It was a few months ago.  You do know what I'm talking about because you
>> just expounded with the exact same argument below.  It's like a broken
>> record.
>
> While I am gratified that you apparently memorise and obsess over things
> I wrote months ago, I'm sorry to tell you that I wasn't lying when I said
> that I didn't know what you were talking about. I had no idea that you
> were referring to a completely different conversation, nor do I recall
> every post I write here.
>
> If I repeated the same argument, it is because the argument is still
> valid. Drawing the root of the tree at the top of the page is just a
> convention, just driving on the left side of the road, or calling the
> elected head of state "Prime Minister". There are other ways to do such
> things which are equally valid, and so long as both parties agree on the
> convention, it doesn't matter whether you write from left-to-right like
> in Australia, right-to-left like in Egypt, or alternate like in Israel.
>
>
>> (Now if *I* sound like a broken record, it's because no seems
>> to see the obvious, but carry on.)
>
> It must be such a trial to be the only sane man in a world gone mad.
>
>
> [...]
>>> What matters is the relationships between the entities, not the
>>> specific direction they are drawn in relative to some imaginary
>>> absolute space. [yadda, yagni, yadda]
>>
>> But, there IS A DIFFERENCE.  Let me explain the concept of a object
>> model (or "type model" if you prefer).
>>
>> In a family inheritance tree,  there is this difference -- called the
>> "calendar" --  which imposes an ordering which can't be countermanded by
>> flipping your silly chart around.  You made a bullshit example to simply
>> argue a point and *fooled yourself* into ignoring this.  Yes?
>
> No. You haven't explained anything, you have merely made an assertion
> with no supporting evidence at all.
>
> In a family tree of ancestors and descendants, the relationship being
> draw is time-based. Ancestors exist before descendants. Descendants are
> derived in some way from ancestors, not the other way around. We all
> agree that your father existed before you. The temporal direction of the
> relationship is absolutely fixed, past before present, ancestors before
> descendants. We can agree on this.
>
> Explain to me this: what (apart from mere human convention) imposes the
> ordering "past must be at the top of the page"?
>
> If you are reading this as email, your mail client very likely has an
> option to sort message in order that they were received, either most-
> recent at the top or oldest at the top. Do you really mean to imply that
> one of those is logical and the other is delusional?
>
>
>> Likewise, WITH A COMPUTER, there is a definite order which can't be
>> countermanded by simply having this artifice called "Object". If you
>> FEE(L)s hadn't noticed (no longer using the insult "foo"s out of respect
>> for the sensativities of the brogrammers), this artifice has just been
>> *called on the floor* with this little innocent question that fired up
>> this discussion again (don't hate the messenger). Again:  people
>> entering the community are pointing out a problem -- that Object is both
>> trying to be the BASE and the SUPERclass of all objects.
>
> How is this a problem? They mean the same thing.
>
> A television is both an appliance and a device. object is both the base
> class and a superclass of all other classes.
>
>
>> CS554: A type/object *model* has to define the relationship of these
>> nice abstractions so that they can be mapped to the *actual
>> concreteness* of the machine.  And there, bro, there is an ordering.
>
> Yes, the ordering is that the subclass is derived from the superclass.
> Nobody disputes that. But we can show that relationship using any
> convention we like:
>
>
> superclass -> subclass
>
> subclass <- superclass
>
> "superclass extended by subclass"
>
> "subclass extends superclass"
>
> superclass
>     ↓
> subclass
>
>
> subclass
>     ↑
> superclass
>
>
> Python syntax:
>      class MySubclass(MySuperclass): ...
>
>
> Smalltalk syntax:
>      MySuperclass :subclass #MySubclass
>
>
> Java syntax:
>      class MySubclass extends MySuperclass {...}
>
>
>
>> You're not going to magically flip the hierarchy so that your bitless
>> Object becomes a machine word that is the base of all your types.
>
> You seem to be labouring under the delusion that inheritance, which is a
> high-level concept which only applies to objects, goes "all the way down"
> to low-level concepts like words and bits.
>
> Objects do not *inherit* from bits. They are *composed* of bits.
>
>
>> You've
>> been fooled by the magic of the Turing Machine.   The modern computer
>> mollifies you with the illusion of "total abstraction" where there are
>> no bits or 1s and 0s involved, but yea, it did not turn out that way.
>> (Note bene: as a comparison, C++ is very UNAMBIGUOUS about this fact --
>> all objects inherit from concrete machine types, which is why it remains
>> important, *despite* being one of the worst to do OOP in.  Its *type
>> model* is probably the most clear of any object-oriented language).
>
> You haven't actually programmed in C++ have you?
>
> There's no shame in answering that you haven't. I've never programmed in
> C++. It's on my to-do list, after giving myself an appendectomy with a
> dull rusty knife and just ahead of buying the complete collection of
> Justin Bieber albums. But even I know that you cannot inherit from native
> types, on account that they aren't objects.
>
>
>>> Likewise it doesn't matter whether we draw class hierarchies from the
>>> top down or the bottom up or even sidewise:
>>
>> Have you caught it by now, friends:  IT MATTERS TO THE COMPUTER.
>
> How the hell does the computer know which way I draw my class diagrams?
>
>
>

And the cycle continues:

1. A thread mentions some fundamental aspect of computing.

2. Mark Janssen jumps in to hint that we are all confused, and he knows 
how things should really work, with no details.

3. The discussion expands to the point of Mark making some claim which 
sounds close to a truth, but seems actually wrong ("It matters to the 
computer").

4. Reasonable people try to engage in an actual discussion of what was said.

5. (Coming next) Mark ignores the bulk of the discussion, picks out one 
detail, and continues making snide and incorrect remarks, skittering 
away from the light of reason.

Maybe we could just not?

-- 
Ned Batchelder, http://nedbatchelder.com

[toc] | [prev] | [next] | [standalone]


#61432

FromSteven D'Aprano <steve@pearwood.info>
Date2013-12-10 03:19 +0000
Message-ID<52a68851$0$2829$c3e8da3$76491128@news.astraweb.com>
In reply to#61378
On Mon, 09 Dec 2013 05:59:29 -0500, Ned Batchelder wrote:

[...]
> And the cycle continues:
[...]

> Maybe we could just not?

A reasonable request, but just because it's reasonable doesn't mean it is 
a no-brainer that we shouldn't engage with Mark.

While I'm very confident at this point that he is a crank, in the same 
category as circle-squarers, cold fusion proponents, pi-is-a-rational-
number theorists, perpetual motion machine inventors, evolution or AGW 
Denialists[1], and other such obsessive examples of Dunning-Kruger, I'm 
not *totally* confident that he is a crank. Maybe he'll prove me wrong 
and actually learn something. Who knows, maybe *I'll* learn something!

Even if Mark is a crank and beyond the reach of logic, reason or facts, 
and I'm 90% convinced his is, consider that he's not the only one reading 
this thread. If just one person learns something useful or new from a 
reply to Mark, I believe that it is worthwhile.

I daresay that at some point I'll make the same decision as you, that the 
pain of answering Mark is not worth the benefit to readers, or perhaps 
that there aren't any readers who will learn something new. But I'm not 
there yet. (Perhaps I'm just slow.)

Speaking of cranks, anyone unaware of the Crack-pot index should check it 
out: http://math.ucr.edu/home/baez/crackpot.html

It's probably more entertaining for those who have actually spent time 
engaging with cranks in the sciences (e.g. Relativity Denialists) or 
mathematics.




[1] A lot of people dislike the term Denialist. I justify it this way -- 
there is a difference between those who merely have doubts about the 
existence of something (say, evolution, global warming, the Holocaust, 
Operation Gladio, Shakespeare, etc.) and a Denialist. Those doubts don't 
even need to be *reasonable* doubts. If the person happens to be 
unknowledgeable (i.e. ignorant) about the subject in question, their 
doubts may be unreasonable relative to the state of knowledge. What 
matters is whether the person doing the doubting is reasonable. Denialists 
are cranks. Not all people who deny, dispute or question accepted 
knowledge are cranks.

Normally the difference between a crank and a non-crank is relatively 
obvious. One very strong sign is to ask the question "what evidence would 
change your mind?". If the answer is either "no evidence at all will 
change my mind", or something which is impossible to satisfy (e.g. "I 
won't accept evolution until I see a chicken give birth to a human 
being"), then the person is a crank and hence the term Denialist is 
likely to be apt.


-- 
Steven

[toc] | [prev] | [next] | [standalone]


#61435

Fromrusi <rustompmody@gmail.com>
Date2013-12-09 20:32 -0800
Message-ID<07e43ef4-a2d9-420c-9760-a78a48e6dad6@googlegroups.com>
In reply to#61432
On Tuesday, December 10, 2013 8:49:46 AM UTC+5:30, Steven D'Aprano wrote:
> On Mon, 09 Dec 2013 05:59:29 -0500, Ned Batchelder wrote:

> [...]
> > And the cycle continues:
> [...]

> > Maybe we could just not?

Thanks Ned for your attempts at bringing some order and sense in these parts
of the universe

> A reasonable request, but just because it's reasonable doesn't mean it is 
> a no-brainer that we shouldn't engage with Mark.

Some basic statistics

Suppose a random variable X takes 2 values x and y with probabilities
p and q=1-p. Then expected value of X

E[X] = px + qy

p = probability of some good result from an interaction
q = 1-p = No good
x = benefit value
y = harm value

> Even if Mark is a crank and beyond the reach of logic, reason or facts, 
> and I'm 90% convinced his is, consider that he's not the only one reading 
> this thread. 

So you are pegging 'no-good-probability' at 90% and so p at 10%. Ok
lets accept these.

And in the benefit value you include the possible benefit to Mark, to
whoever engages with him and the random [no relation of random
variable X] lurking reader. So far so good

And in the harm-value y, are you including the harm done to the random reader 
from a disorderly, abusive, fruitless and almost completely OT  
conversation?

> If just one person learns something useful or new from a 
> reply to Mark, I believe that it is worthwhile.

And if 3 people drop out because the levels of bullshit have crossed their 
thresholds?

[BTW: My statistics was never very strong and is now quite rusty.
So...
Whos that guy who recently added a stats module to python??
Cant remember his name... Maybe I should take some tuitions from him...]

[toc] | [prev] | [next] | [standalone]


#61437

FromSteven D'Aprano <steve@pearwood.info>
Date2013-12-10 05:10 +0000
Message-ID<52a6a242$0$2829$c3e8da3$76491128@news.astraweb.com>
In reply to#61435
On Mon, 09 Dec 2013 20:32:06 -0800, rusi wrote:

> On Tuesday, December 10, 2013 8:49:46 AM UTC+5:30, Steven D'Aprano
> wrote:
>> On Mon, 09 Dec 2013 05:59:29 -0500, Ned Batchelder wrote:
> 
>> [...]
>> > And the cycle continues:
>> [...]
> 
>> > Maybe we could just not?
> 
> Thanks Ned for your attempts at bringing some order and sense in these
> parts of the universe
> 
>> A reasonable request, but just because it's reasonable doesn't mean it
>> is a no-brainer that we shouldn't engage with Mark.
> 
> Some basic statistics
> 
> Suppose a random variable X takes 2 values x and y with probabilities p
> and q=1-p. Then expected value of X
> 
> E[X] = px + qy
> 
> p = probability of some good result from an interaction 

Define "good result".


> q = 1-p = No good

Define "No good".

> x = benefit value
> y = harm value
> 
>> Even if Mark is a crank and beyond the reach of logic, reason or facts,
>> and I'm 90% convinced his is, consider that he's not the only one
>> reading this thread.
> 
> So you are pegging 'no-good-probability' at 90% and so p at 10%. Ok lets
> accept these.

Certainly not. I'm pegging my confidence that Mark is a crank at 90%, 
which is not the same thing.

For example, although Mark is (presumably) a crank, nevertheless I have 
brought some enjoyment into your life as it has given you the opportunity 
to regale us all with your opinion on off-topic posts, and show off your 
advanced knowledge of probability *wink* That counts as a good result.


> And in the benefit value you include the possible benefit to Mark, to
> whoever engages with him and the random [no relation of random variable
> X] lurking reader. So far so good
> 
> And in the harm-value y, are you including the harm done to the random
> reader from a disorderly, abusive, fruitless and almost completely OT
> conversation?

You are conflating the magnitude of harm with the probability of harm. 
But please, do continue in your off-topic rant complaining about off-
topic conversations, I'm sure that we're all learning either something or 
possibly nothing from it.


>> If just one person learns something useful or new from a reply to Mark,
>> I believe that it is worthwhile.
> 
> And if 3 people drop out because the levels of bullshit have crossed
> their thresholds?

I don't know. If twelve people are moved to drop out of this group 
because of your post complaining about my post, how would you react? I'd 
probably feel between 0 and 1/4 times as good.

By the way, I'm curious. Why are discussions about object oriented coding 
off-topic to Python? This is not a rhetorical question.



-- 
Steven

[toc] | [prev] | [next] | [standalone]


#61440

Fromrusi <rustompmody@gmail.com>
Date2013-12-09 21:16 -0800
Message-ID<5f7e3e2f-2f86-4a2b-bea5-6e70b6fc2f69@googlegroups.com>
In reply to#61437
On Tuesday, December 10, 2013 10:40:27 AM UTC+5:30, Steven D'Aprano wrote:
> By the way, I'm curious. Why are discussions about object oriented coding 
> off-topic to Python? This is not a rhetorical question.

Well OOP on the python list is certainly on topic.

Interminable discussions about why redrawing the inheritance arrows
the other way round will save the world is OT (for me!)

[toc] | [prev] | [next] | [standalone]


#61443

FromRoy Smith <roy@panix.com>
Date2013-12-10 00:31 -0500
Message-ID<roy-6B05A2.00311510122013@news.panix.com>
In reply to#61440
In article <5f7e3e2f-2f86-4a2b-bea5-6e70b6fc2f69@googlegroups.com>,
 rusi <rustompmody@gmail.com> wrote:

> On Tuesday, December 10, 2013 10:40:27 AM UTC+5:30, Steven D'Aprano wrote:
> > By the way, I'm curious. Why are discussions about object oriented coding 
> > off-topic to Python? This is not a rhetorical question.
> 
> Well OOP on the python list is certainly on topic.
> 
> Interminable discussions about why redrawing the inheritance arrows
> the other way round will save the world is OT (for me!)

What about whether the arrows should have solid heads, open heads, 
barbed heads, double-barbed heads, or circles (filled or open)?  Surely 
you can't expect people to write decent programs when they can't even 
draw the right kind of arrowhead?

[toc] | [prev] | [next] | [standalone]


#61448

FromSteven D'Aprano <steve@pearwood.info>
Date2013-12-10 06:05 +0000
Message-ID<52a6af26$0$2829$c3e8da3$76491128@news.astraweb.com>
In reply to#61443
On Tue, 10 Dec 2013 00:31:15 -0500, Roy Smith wrote:

> In article <5f7e3e2f-2f86-4a2b-bea5-6e70b6fc2f69@googlegroups.com>,
>  rusi <rustompmody@gmail.com> wrote:
> 
>> On Tuesday, December 10, 2013 10:40:27 AM UTC+5:30, Steven D'Aprano
>> wrote:
>> > By the way, I'm curious. Why are discussions about object oriented
>> > coding off-topic to Python? This is not a rhetorical question.
>> 
>> Well OOP on the python list is certainly on topic.
>> 
>> Interminable discussions about why redrawing the inheritance arrows the
>> other way round will save the world is OT (for me!)
> 
> What about whether the arrows should have solid heads, open heads,
> barbed heads, double-barbed heads, or circles (filled or open)?  Surely
> you can't expect people to write decent programs when they can't even
> draw the right kind of arrowhead?

You mock, and so you should, but I just thought I'd mention that there 
are standards for this sort of thing:

http://en.wikipedia.org/wiki/Unified_Modeling_Language

According to UML the type of arrow head does make a difference.



-- 
Steven

[toc] | [prev] | [next] | [standalone]


#61449

FromRoy Smith <roy@panix.com>
Date2013-12-10 01:20 -0500
Message-ID<roy-946AB5.01203010122013@news.panix.com>
In reply to#61448
In article <52a6af26$0$2829$c3e8da3$76491128@news.astraweb.com>,
 Steven D'Aprano <steve@pearwood.info> wrote:
 
> > What about whether the arrows should have solid heads, open heads,
> > barbed heads, double-barbed heads, or circles (filled or open)?  Surely
> > you can't expect people to write decent programs when they can't even
> > draw the right kind of arrowhead?
> 
> You mock, and so you should, but I just thought I'd mention that there 
> are standards for this sort of thing:
> 
> http://en.wikipedia.org/wiki/Unified_Modeling_Language
> 
> According to UML the type of arrow head does make a difference.

Surely you realize that such a carefully constructed mock could not have 
been generated without knowledge of the mockee?  UML, like so many 
things, started out with a few good ideas.  Giving some structure to how 
you sketch out classes on a whiteboard was a good idea.  Sequence 
diagrams, in particular, are a neat way to understand complicated 
control flows.

I've even used UML tools to make sense of some huge pile of C++ code 
that was tossed my way.  Import the code, then start shoving boxes 
around on the screen until some sort of logical structure emerges.

But, once things got to there being N different types of arrowheads, 
each having some magical significance, they lost me.

PS: other things that fall into the "Some good basic ideas, but got 
totally out of hand" include Agile, Six Sigma, and Perl.

[toc] | [prev] | [next] | [standalone]


#61453

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2013-12-10 09:37 +0000
Message-ID<mailman.3816.1386668280.18130.python-list@python.org>
In reply to#61440
On 10/12/2013 05:16, rusi wrote:
> On Tuesday, December 10, 2013 10:40:27 AM UTC+5:30, Steven D'Aprano wrote:
>> By the way, I'm curious. Why are discussions about object oriented coding
>> off-topic to Python? This is not a rhetorical question.
>
> Well OOP on the python list is certainly on topic.
>
> Interminable discussions about why redrawing the inheritance arrows
> the other way round will save the world is OT (for me!)
>

One of the great joys of reading this list is how wonderfully OT it can 
get.  I have the right to make this statement as I started *THIS* 
thread.  Now what *WERE* we talking about? :)

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#61459

Fromrusi <rustompmody@gmail.com>
Date2013-12-10 03:51 -0800
Message-ID<3b28f40f-cf67-49ef-8047-b7eea936d78a@googlegroups.com>
In reply to#61453
On Tuesday, December 10, 2013 3:07:36 PM UTC+5:30, Mark Lawrence wrote:
> On 10/12/2013 05:16, rusi wrote:
> > On Tuesday, December 10, 2013 10:40:27 AM UTC+5:30, Steven D'Aprano wrote:
> >> By the way, I'm curious. Why are discussions about object oriented coding
> >> off-topic to Python? This is not a rhetorical question.
> > Well OOP on the python list is certainly on topic.
> > Interminable discussions about why redrawing the inheritance arrows
> > the other way round will save the world is OT (for me!)

> One of the great joys of reading this list is how wonderfully OT it can 
> get.  I have the right to make this statement as I started *THIS* 
> thread.  Now what *WERE* we talking about? :)


My boy, I see that you are making progress towards your guru -- Nikos.

"You are spamming MY THREAD"

[toc] | [prev] | [next] | [standalone]


#61514

Fromalex23 <wuwei23@gmail.com>
Date2013-12-11 12:04 +1000
Message-ID<l88h7a$qof$1@dont-email.me>
In reply to#61453
On 10/12/2013 7:37 PM, Mark Lawrence wrote:
> One of the great joys of reading this list is how wonderfully OT it can
> get.  I have the right to make this statement as I started *THIS*
> thread.  Now what *WERE* we talking about? :)

The God Object (or Higgs Object for the non-theists).

[toc] | [prev] | [next] | [standalone]


#61457

FromIan Kelly <ian.g.kelly@gmail.com>
Date2013-12-10 04:35 -0700
Message-ID<mailman.3819.1386675349.18130.python-list@python.org>
In reply to#61432
On Mon, Dec 9, 2013 at 8:19 PM, Steven D'Aprano <steve@pearwood.info> wrote:
> While I'm very confident at this point that he is a crank, in the same
> category as circle-squarers, cold fusion proponents, pi-is-a-rational-
> number theorists, perpetual motion machine inventors, evolution or AGW
> Denialists[1], and other such obsessive examples of Dunning-Kruger, I'm
> not *totally* confident that he is a crank. Maybe he'll prove me wrong
> and actually learn something. Who knows, maybe *I'll* learn something!

I would compare him more closely to the "Einstein was wrong" armchair
physics revisionists, myself.

[toc] | [prev] | [next] | [standalone]


#61348

FromChris Angelico <rosuav@gmail.com>
Date2013-12-09 13:44 +1100
Message-ID<mailman.3754.1386557044.18130.python-list@python.org>
In reply to#61284
On Mon, Dec 9, 2013 at 10:01 AM, Mark Janssen <dreamingforward@gmail.com> wrote:
> (Note bene: as a comparison, C++ is very UNAMBIGUOUS about
> this fact -- all objects inherit from concrete machine types, which is
> why it remains important, *despite* being one of the worst to do OOP
> in.  Its *type model* is probably the most clear of any
> object-oriented language).

Factually wrong. In C++, it is actually *impossible* to inherit from a
"concrete machine type", by which presumably you mean the classic
types int/char/float etc.

struct foo: public int
{
        foo() {}
};

1.cpp:1:20: error: expected class-name before ‘int’
1.cpp:1:20: error: expected ‘{’ before ‘int’
1.cpp:2:1: error: expected unqualified-id before ‘{’ token

Okay, that's a parse error. Maybe if we avoid the language keyword?

typedef int integer;

struct foo: public integer
{
        foo() {}
};

1.cpp:4:1: error: expected class-name before ‘{’ token

Nope. There are two completely different groups here: the basic types
(called here [1] "Fundamental data types") and the structure types.
The latter are created by the struct/class keyword and can use
inheritance. The former... aren't. Not every C++ type is part of the
type hierarchy.

This is actually somewhat true of Python, too, but the set of types
that are unavailable for inheritance is much smaller and less useful.
You can't inherit from the 'function' type, for instance:

>>> class foo(type(lambda:1)):
pass

Traceback (most recent call last):
  File "<pyshell#80>", line 1, in <module>
    class foo(type(lambda:1)):
TypeError: type 'function' is not an acceptable base type

And yet <class 'function'> inherits from class <'object'>, so it's not
entirely outside in the way C++ int is. And I can apparently subclass
module, though not generator, and unsurprisingly NoneType can't be
inherited from. (Though you can instantiate it, and it's probably the
only class that will appear to have no return value from
instantiation.)

C++ has you *compose* structs/classes from primitives, but this is not
the same as inheritance. They're completely separate concepts.

ChrisA

[1] http://www.cplusplus.com/doc/tutorial/variables/

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.python


csiph-web