FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-patterns/borg.py at master · unicode48/python-patterns · GitHub
unicode48
/
python-patterns
Public
forked from
faif/python-patterns
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python-patterns
/
borg.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
24 lines (17 loc) · 497 Bytes
Breadcrumbs
python-patterns
/
borg.py
Copy path
File metadata and controls
24 lines (17 loc) · 497 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class
Borg
:
__shared_state
=
{}
def
__init__
(
self
):
self
.
__dict__
=
self
.
__shared_state
self
.
state
=
'Running'
def
__str__
(
self
):
return
self
.
state
if
__name__
==
'__main__'
:
rm1
=
Borg
()
rm2
=
Borg
()
print
(
'rm1 state: {}'
.
format
(
rm1
))
print
(
'rm2 state: {}'
.
format
(
rm2
))
rm2
.
state
=
'Idle'
print
(
'rm1 state: {}'
.
format
(
rm1
))
print
(
'rm2 state: {}'
.
format
(
rm2
))
print
(
'rm1 id: {}'
,
id
(
rm1
))
print
(
'rm2 id: {}'
,
id
(
rm2
))
Back
|
FazBrowse Home
|
New Git URL