python:about_python:about_python_iii
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
python:about_python:about_python_iii [2013/07/05 06:16] – created mithat | python:about_python:about_python_iii [2017/12/06 01:57] (current) – mithat | ||
---|---|---|---|
Line 33: | Line 33: | ||
In computing, we call objects that have been created from classes **instances**. Thus Jimmy' | In computing, we call objects that have been created from classes **instances**. Thus Jimmy' | ||
- | |||
- | Python uses class-based object orientation. | ||
=== Prototype-based object orientation === | === Prototype-based object orientation === | ||
- | There is another kind of object orientation called **prototype-based object orientation** or **prototype-based programming**. This is the kind of object-orientation used in JavaScript and some other languages. I will leave it you to get your Google on and learn more about prototype-based object orientation. | + | There is another kind of object orientation called **prototype-based object orientation** or **prototype-based programming**. This is the kind of object-orientation used in JavaScript and some other languages.((C++, Java, C#, and PHP support only class-based object orientation; |
- | You can do prototype-based programming with Python | + | ==== Python |
- | ==== Python | + | Python |
We will next define a class in Python and instantiate and use some objects. | We will next define a class in Python and instantiate and use some objects. | ||
Line 163: | Line 161: | ||
class ClickerCounter(): | class ClickerCounter(): | ||
def __init__(self): | def __init__(self): | ||
- | count = 0 | + | |
| | ||
def get_count(self): | def get_count(self): | ||
Line 181: | Line 179: | ||
class ClickerCounter(): | class ClickerCounter(): | ||
def __init__(self): | def __init__(self): | ||
- | count = 0 | + | |
| | ||
def set_count(self, | def set_count(self, | ||
Line 223: | Line 221: | ||
== Properties == | == Properties == | ||
- | While the " | + | While the " |
Copyright © 2011 Mithat Konar. All rights reserved. | Copyright © 2011 Mithat Konar. All rights reserved. |
python/about_python/about_python_iii.1373004970.txt.gz · Last modified: 2013/07/05 06:16 by mithat