Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bslatkin/effectivepython
/ get_database
Function
get_database
example_code/item_112.py:132–136 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
130
DATABASE = None
131
132
def
get_database():
133
global DATABASE
134
if
DATABASE is None:
135
DATABASE = ZooDatabase()
136
return
DATABASE
137
138
def
main(argv):
139
database = get_database()
Callers
1
main
Function · 0.85
Calls
1
ZooDatabase
Class · 0.85
Tested by
no test coverage detected