Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #94617
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: scalar vs array and program control |
| Date | 2015-07-26 12:35 +0200 |
| Organization | PointedEars Software (PES) |
| Message-ID | <2035096.cBO6vpb5vr@PointedEars.de> (permalink) |
| References | (2 earlier) <1619647.1FW7hyz6Jq@PointedEars.de> <mailman.978.1437831852.3674.python-list@python.org> <1757573.rN60lcJNyZ@PointedEars.de> <mailman.989.1437846349.3674.python-list@python.org> <1852361.ZT26voajJO@PointedEars.de> |
Thomas 'PointedEars' Lahn wrote:
> Laura Creighton wrote:
>> and to create a class where none was before to make it more object-
>> oriented.
>
> I did not need to, but, again, it was more obvious that way. I could also
> have used an existing class, and its existing or newly added method.
> AISB, almost everything in Python is an object; therefore, almost
> everything in Python has a class (try “print((42)).__class__)” in Py3k).
^
> […]
| >>> print((42).__class__)
| <class 'int'>
Most interesting (but understandable):
| >>> print(42..__class__)
| <class 'float'>
BTW, another common misconception that I read from your argument is that
“object-oriented” would be synonymous with “class-based”; that one needs a
class for OOP. In fact, however, there are several object-oriented
programming languages, again for example most ECMAScript implementations,
that are prototype-based: one object/instance inherits from another, its
prototype.
--
PointedEars
Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: scalar vs array and program control Laura Creighton <lac@openend.se> - 2015-07-25 13:01 +0200
Re: scalar vs array and program control Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-25 14:57 +0200
Re: scalar vs array and program control Laura Creighton <lac@openend.se> - 2015-07-25 15:43 +0200
Re: scalar vs array and program control Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-25 18:53 +0200
Re: scalar vs array and program control Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-25 18:56 +0200
Re: scalar vs array and program control Laura Creighton <lac@openend.se> - 2015-07-25 19:45 +0200
Re: scalar vs array and program control Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-26 12:26 +0200
Re: scalar vs array and program control Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-07-26 12:35 +0200
csiph-web