Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
method_overriding
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Brady James Garvin
method_overriding
Commits
984d91af
Commit
984d91af
authored
5 years ago
by
Brady James Garvin
Browse files
Options
Downloads
Patches
Plain Diff
Deferred example of duck typing.
parent
29859906
Branches
master
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
notes.py
+0
-29
0 additions, 29 deletions
notes.py
with
0 additions
and
29 deletions
notes.py
deleted
100644 → 0
+
0
−
29
View file @
29859906
class
Visit
(
object
):
def
__init__
(
self
):
self
.
notes
=
[]
def
add_note
(
self
,
note
):
self
.
notes
.
append
(
note
)
class
Appointment
(
object
):
def
__init__
(
self
):
self
.
note
=
None
def
add_note
(
self
,
note
):
self
.
note
=
note
def
void
(
event
):
event
.
add_note
(
'
Voided.
'
)
if
__name__
==
'
__main__
'
:
visit
=
Visit
()
appointment
=
Appointment
()
number
=
7
void
(
visit
)
print
(
visit
.
notes
)
void
(
appointment
)
print
(
appointment
.
note
)
void
(
number
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment