Skip to content

Commit fac39da

Browse files
committed
add get_turtle to __all__
1 parent 262f007 commit fac39da

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

jupyturtle.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def pendown(self):
228228
################################################## procedural API
229229

230230
# _install_command() will append more names when the module loads
231-
__all__ = ['Turtle', 'make_turtle']
231+
__all__ = ['Turtle', 'make_turtle', 'get_turtle']
232232

233233

234234
def __dir__():
@@ -239,13 +239,15 @@ def __dir__():
239239

240240

241241
def make_turtle(delay=0):
242+
"""Makes and sets new _main_turtle"""
242243
global _main_turtle
243244
_main_turtle = Turtle(delay)
244245

245246

246-
def _get_turtle():
247+
def get_turtle():
248+
"""Gets _main_turtle; makes it if there's none"""
247249
global _main_turtle
248-
if not _main_turtle:
250+
if _main_turtle is None:
249251
_main_turtle = Turtle()
250252
return _main_turtle
251253

0 commit comments

Comments
 (0)