Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
2
2 Semester Practice 2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Щербинин Артем Владимирович
2 Semester Practice 2
Commits
349c3bbc
Commit
349c3bbc
authored
Jun 21, 2025
by
Щербинин Артем Владимирович
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
0a85a4dc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
lazy.py
Задание_2.2._ВСР_Щербинин_А._В./lazy.py
+13
-0
No files found.
Задание_2.2._ВСР_Щербинин_А._В./lazy.py
0 → 100644
View file @
349c3bbc
class
LazySingleton
:
_instance
=
None
def
__new__
(
cls
):
if
cls
.
_instance
is
None
:
cls
.
_instance
=
super
(
LazySingleton
,
cls
)
.
__new__
(
cls
)
return
cls
.
_instance
if
__name__
==
"__main__"
:
singleton1
=
LazySingleton
()
singleton2
=
LazySingleton
()
print
(
singleton1
is
singleton2
)
Write
Preview
Markdown
is supported
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