summaryrefslogtreecommitdiffhomepage
path: root/python.html.markdown
diff options
context:
space:
mode:
authorsumanstats <suman81765@gmail.com>2020-06-15 20:42:57 +0545
committersumanstats <suman81765@gmail.com>2020-06-15 20:42:57 +0545
commitd78605e0d7839c6c9e7ccf9d07a041800e6d340b (patch)
tree8b1c564494a071d311e19e4818a6e10cb533b307 /python.html.markdown
parent0ecb8264293d852f2ef586279885848b621668d1 (diff)
Reflect perl6 to raku rename
+ As mentioned here: https://github.com/Raku/problem-solving/blob/master/solutions/language/Path-to-Raku.md perl6 is renamed to raku + change references of perl6 to raku + change extension from .p6 to .raku + fix the link of raku advent calendar
Diffstat (limited to 'python.html.markdown')
-rw-r--r--python.html.markdown16
1 files changed, 8 insertions, 8 deletions
diff --git a/python.html.markdown b/python.html.markdown
index 25798ade..53303442 100644
--- a/python.html.markdown
+++ b/python.html.markdown
@@ -772,11 +772,11 @@ if __name__ == '__main__':
# Call the static method
print(Human.grunt()) # => "*grunt*"
-
- # Cannot call static method with instance of object
+
+ # Cannot call static method with instance of object
# because i.grunt() will automatically put "self" (the object i) as an argument
print(i.grunt()) # => TypeError: grunt() takes 0 positional arguments but 1 was given
-
+
# Update the property for this instance
i.age = 42
# Get the property
@@ -792,7 +792,7 @@ if __name__ == '__main__':
####################################################
# Inheritance allows new child classes to be defined that inherit methods and
-# variables from their parent class.
+# variables from their parent class.
# Using the Human class defined above as the base or parent class, we can
# define a child class, Superhero, which inherits the class variables like
@@ -926,7 +926,7 @@ class Batman(Superhero, Bat):
# So instead we explicitly call __init__ for all ancestors.
# The use of *args and **kwargs allows for a clean way to pass arguments,
# with each parent "peeling a layer of the onion".
- Superhero.__init__(self, 'anonymous', movie=True,
+ Superhero.__init__(self, 'anonymous', movie=True,
superpowers=['Wealthy'], *args, **kwargs)
Bat.__init__(self, *args, can_fly=False, **kwargs)
# override the value for the name attribute
@@ -941,9 +941,9 @@ if __name__ == '__main__':
# Get the Method Resolution search Order used by both getattr() and super().
# This attribute is dynamic and can be updated
- print(Batman.__mro__) # => (<class '__main__.Batman'>,
- # => <class 'superhero.Superhero'>,
- # => <class 'human.Human'>,
+ print(Batman.__mro__) # => (<class '__main__.Batman'>,
+ # => <class 'superhero.Superhero'>,
+ # => <class 'human.Human'>,
# => <class 'bat.Bat'>, <class 'object'>)
# Calls parent method but uses its own class attribute