Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #61172 > unrolled thread
| Started by | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| First post | 2013-12-06 17:03 +0000 |
| Last post | 2013-12-08 07:11 -0500 |
| Articles | 6 on this page of 26 — 11 participants |
Back to article view | Back to comp.lang.python
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 2 of 2 — ← Prev page 1 [2]
| From | Mark Janssen <dreamingforward@gmail.com> |
|---|---|
| Date | 2013-12-08 19:05 -0800 |
| Message-ID | <mailman.3756.1386558320.18130.python-list@python.org> |
| In reply to | #61284 |
On Sun, Dec 8, 2013 at 6:44 PM, Chris Angelico <rosuav@gmail.com> wrote: > 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. Wow, you guys trip me out, but I guess I've been working in a different universe where I was mapping classes into basic types (using generic programming along with typedef). I'm going to have to re-think all this confusion. But, in any case, if you don't have a way to map your abstract objects into machine types, you're working on magic, not computer science. MarkJ Tacoma, Washington
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-12-09 14:17 +1100 |
| Message-ID | <mailman.3758.1386559028.18130.python-list@python.org> |
| In reply to | #61284 |
On Mon, Dec 9, 2013 at 2:05 PM, Mark Janssen <dreamingforward@gmail.com> wrote:
> But, in any case, if you don't have a way to map your abstract objects
> into machine types, you're working on magic, not computer science.
Maybe, but that mapping isn't always an inheritance relationship.
Ultimately the computer can't work with my data without it being
represented in memory and in registers (at least in part - "relational
database" could be considered a type, the full implementation of which
is never actually loaded into memory), but the most common way to do
this is effectively some form of composition. For instance, C++ has a
type called "pair" (actually a template); what's the most obvious way
to define the type "pair of integers"? Place the first integer, then
place the second integer. The pair has two members, first and second.
The pair isn't the first integer, nor is it the second integer. It
doesn't make sense to inherit pair from integer, so you don't. You
compose it of two integers.
class Pair(object):
# in C++, we'd need to declare these:
# int first;
# int second;
def __init__(self, first, second):
self.first, self.second = first, second
Calling integer methods on a Pair makes no sense. Which of its members
did you want to call that on? Both of them? (Wouldn't make sense if
you had a mixed pair, like pair<employee,gun> which could be a little
awkward to try to fire().) You can't sensibly use a Pair in a context
where an integer would be wanted, so it fails LSP. It composes, but
does not inherit from, int.
ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| Date | 2013-12-09 03:12 -0700 |
| Message-ID | <mailman.3770.1386583975.18130.python-list@python.org> |
| In reply to | #61284 |
On Sun, Dec 8, 2013 at 4:01 PM, Mark Janssen <dreamingforward@gmail.com> wrote: > 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. You're mixing two different terminologies. Whereas "superclass" contrasts with "subclass" and connotes an imaginary spatial relationship, "base" contrasts with "derived" (not "top"), which pairing does not suggest any spatial relationship at all. There is no inconsistency in that these two words happen to mean the same thing. >> 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. No, I'm pretty sure the computer doesn't care one whit whether the inheritance hierarchy that I scribble on a random sheet of paper happens to be represented as top-down, bottom-up, left-right, right-left, center-out, ana-kata, or using any other conceivable spatial relationship that I may have omitted. The computer only cares (inasmuch as I'm willing to personify it) about the actual *code* that I feed into it. How the programmer abstracts or visualizes that code is irrelevant.
[toc] | [prev] | [next] | [standalone]
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2013-12-09 15:06 +0000 |
| Message-ID | <mailman.3781.1386601592.18130.python-list@python.org> |
| In reply to | #61284 |
On 09/12/2013 10:12, Ian Kelly wrote: > On Sun, Dec 8, 2013 at 4:01 PM, Mark Janssen <dreamingforward@gmail.com> wrote: >> 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. > > You're mixing two different terminologies. Whereas "superclass" > contrasts with "subclass" and connotes an imaginary spatial > relationship, "base" contrasts with "derived" (not "top"), which > pairing does not suggest any spatial relationship at all. There is no > inconsistency in that these two words happen to mean the same thing. > >>> 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. > > No, I'm pretty sure the computer doesn't care one whit whether the > inheritance hierarchy that I scribble on a random sheet of paper > happens to be represented as top-down, bottom-up, left-right, > right-left, center-out, ana-kata, or using any other conceivable > spatial relationship that I may have omitted. The computer only cares > (inasmuch as I'm willing to personify it) about the actual *code* that > I feed into it. How the programmer abstracts or visualizes that code > is irrelevant. > MASCOT is the One True Way http://en.wikipedia.org/wiki/Modular_Approach_to_Software_Construction_Operation_and_Test -- 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]
| From | Gregory Ewing <greg.ewing@canterbury.ac.nz> |
|---|---|
| Date | 2013-12-09 12:15 +1300 |
| Message-ID | <bgkcs7F9kdiU1@mid.individual.net> |
| In reply to | #61270 |
Mark Janssen wrote: > Mr. Ewing says "base" has to be interpreted as an *adjective* because > otherwise it would mean the BOTTOM (like the BASE of the pyramid), Not exactly -- a native English speaker would say something like "the bottommost class" if that's what they meant. Or they would say "the most basic class" to mean the simplest one -- but that's not quite what we mean either. The only way that "most base class" makes grammatical sense is if you interpret "base" as meaning "undesirable", as in "base metal" (i.e. a non-precious metal), "base instinct" (the kind of animal urges that humans are meant to be too good for), etc. > while Terry responds that it is the TOP (*super*class). Yeah, "top" or "bottom" only conveys the right idea if you assume the diagram is drawn a particular way up. Which is why I like the term "base class" -- you just need to be careful with the grammar! -- Greg
[toc] | [prev] | [next] | [standalone]
| From | Ned Batchelder <ned@nedbatchelder.com> |
|---|---|
| Date | 2013-12-08 07:11 -0500 |
| Message-ID | <mailman.3724.1386504707.18130.python-list@python.org> |
| In reply to | #61258 |
On 12/7/13 11:21 PM, 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?) Mark, if you want to participate in this forum, please refrain from opening with an insult. I've tried talking with you here in the past, and got nothing but sarcastic sneers and put-downs for my trouble. I gave you the benefit of the doubt, and believed that previous contentious points (no tokens on punched cards, initializing arrays to NaN, etc) were due to misunderstandings that could be worked out. You treated me with contempt and refused to discuss the details that would have let us understand each other. I know you have a theory that all of computer science has been confused for half a century. You expounded on this before, but haven't managed to explain your point clearly, and have not convinced anyone that you have a better model than the ones we're already using. Perhaps we are confused, and you have a better idea. I don't know yet, though frankly I doubt it. I'd be glad to learn about your ideas, but you have to present them seriously, and with some humility, to get them to spread. So far, repeated attempts to get details from you have failed. > > 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. I'm sorry you feel martyred. It's not because you bring truth to crazy-confused people. It's because you can't explain yourself, and you push people away with your style. We try hard to treat each other with respect, and I'll ask you to do the same. > > MarkJ > Tacoma, Washington > -- Ned Batchelder, http://nedbatchelder.com
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | comp.lang.python
csiph-web