Return the singleton screen object. If none exists at the moment, create a new one and return it, else return the existing one.
()
| 3554 | ### Screen - Singleton ######################## |
| 3555 | |
| 3556 | def Screen(): |
| 3557 | """Return the singleton screen object. |
| 3558 | If none exists at the moment, create a new one and return it, |
| 3559 | else return the existing one.""" |
| 3560 | if Turtle._screen is None: |
| 3561 | Turtle._screen = _Screen() |
| 3562 | return Turtle._screen |
| 3563 | |
| 3564 | class _Screen(TurtleScreen): |
| 3565 |