Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
system-design-primer
Commits
01789430
Commit
01789430
authored
Mar 18, 2018
by
cclauss
Committed by
Donne Martin
Mar 18, 2018
Browse files
Add missing colons to class methods (#143)
parent
38a93dc1
Changes
2
Hide whitespace changes
Inline
Side-by-side
solutions/object_oriented_design/lru_cache/lru_cache.py
View file @
01789430
...
@@ -29,7 +29,7 @@ class Cache(object):
...
@@ -29,7 +29,7 @@ class Cache(object):
self
.
lookup
=
{}
# key: query, value: node
self
.
lookup
=
{}
# key: query, value: node
self
.
linked_list
=
LinkedList
()
self
.
linked_list
=
LinkedList
()
def
get
(
self
,
query
)
def
get
(
self
,
query
)
:
"""Get the stored query result from the cache.
"""Get the stored query result from the cache.
Accessing a node updates its position to the front of the LRU list.
Accessing a node updates its position to the front of the LRU list.
...
...
solutions/system_design/query_cache/query_cache_snippets.py
View file @
01789430
...
@@ -52,7 +52,7 @@ class Cache(object):
...
@@ -52,7 +52,7 @@ class Cache(object):
self
.
lookup
=
{}
self
.
lookup
=
{}
self
.
linked_list
=
LinkedList
()
self
.
linked_list
=
LinkedList
()
def
get
(
self
,
query
)
def
get
(
self
,
query
)
:
"""Get the stored query result from the cache.
"""Get the stored query result from the cache.
Accessing a node updates its position to the front of the LRU list.
Accessing a node updates its position to the front of the LRU list.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment