Difference between revisions of "Classes"

From wikieduonline
Jump to navigation Jump to search
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[wikipedia:Classes]]
 
[[wikipedia:Classes]]
  
 +
* [[Python]] https://docs.python.org/3/tutorial/classes.html
 +
[[global]]
 +
[[nonlocal]]
  
* [[Inheritance]]
 
  
 +
class Dog:
 +
    mykind = 'canine'        # class variable shared by all instances
 +
    def __init__(self, name):
 +
        self.name = name    # instance variable unique to each instance
 +
 +
Empty class <code>MyEmployee</code>
 +
class MyEmployee:
 +
    pass
  
* [[Python]] https://docs.python.org/3/tutorial/classes.html
 
<code>[[global]]</code>
 
<code>[[nonlocal]]</code>
 
  
 
== Related ==
 
== Related ==
 
* [[Methods]]
 
* [[Methods]]
 +
* [[Inheritance]]
 +
* [[Iterators]] https://docs.python.org/3/tutorial/classes.html#iterators
 +
* [[Generators]] https://docs.python.org/3/tutorial/classes.html#generators
  
 
== See also ==
 
== See also ==

Latest revision as of 17:57, 3 March 2022

Advertising: