Difference between revisions of "Classes"

From wikieduonline
Jump to navigation Jump to search
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[wikipedia:Classes]]
 
[[wikipedia:Classes]]
 
 
* [[Inheritance]]
 
 
  
 
* [[Python]] https://docs.python.org/3/tutorial/classes.html
 
* [[Python]] https://docs.python.org/3/tutorial/classes.html
  <code>[[global]]</code>
+
  [[global]]
  <code>[[nonlocal]]</code>
+
  [[nonlocal]]
  
  
 
  class Dog:
 
  class Dog:
     kind = 'canine'        # class variable shared by all instances
+
     mykind = 'canine'        # class variable shared by all instances
 
     def __init__(self, name):
 
     def __init__(self, name):
 
         self.name = name    # instance variable unique to each instance
 
         self.name = name    # instance variable unique to each instance
  
 +
Empty class <code>MyEmployee</code>
 +
class MyEmployee:
 +
    pass
  
  
 
== 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: