Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xAAL
Code
Python
Commits
75541103
Commit
75541103
authored
4 months ago
by
KERDREUX Jerome
Browse files
Options
Downloads
Patches
Plain Diff
Format
parent
27cff7fa
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
First try of type hints
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libs/lib/xaal/lib/bindings.py
+6
-5
6 additions, 5 deletions
libs/lib/xaal/lib/bindings.py
with
6 additions
and
5 deletions
libs/lib/xaal/lib/bindings.py
+
6
−
5
View file @
75541103
...
...
@@ -2,12 +2,13 @@ import uuid
from
.exceptions
import
UUIDError
class
UUID
:
def
__init__
(
self
,
*
args
,
**
kwargs
):
self
.
__uuid
=
uuid
.
UUID
(
*
args
,
**
kwargs
)
@staticmethod
def
random_base
(
digit
=
2
)
->
'
UUID
'
:
def
random_base
(
digit
=
2
)
->
"
UUID
"
:
"""
zeros the last digits of a random uuid, usefull w/ you want to forge some addresses
two digit is great.
"""
...
...
@@ -19,15 +20,15 @@ class UUID:
raise
UUIDError
@staticmethod
def
random
()
->
'
UUID
'
:
def
random
()
->
"
UUID
"
:
tmp
=
uuid
.
uuid1
().
int
return
UUID
(
int
=
tmp
)
def
__add__
(
self
,
value
:
int
)
->
'
UUID
'
:
def
__add__
(
self
,
value
:
int
)
->
"
UUID
"
:
tmp
=
self
.
__uuid
.
int
+
value
return
UUID
(
int
=
tmp
)
def
__sub__
(
self
,
value
:
int
)
->
'
UUID
'
:
def
__sub__
(
self
,
value
:
int
)
->
"
UUID
"
:
tmp
=
self
.
__uuid
.
int
-
value
return
UUID
(
int
=
tmp
)
...
...
@@ -52,7 +53,7 @@ class UUID:
def
get
(
self
)
->
uuid
.
UUID
:
return
self
.
__uuid
def
set
(
self
,
value
:
uuid
.
UUID
):
def
set
(
self
,
value
:
uuid
.
UUID
):
self
.
__uuid
=
value
@property
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment