Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pysemigroup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Admin message
GitLab upgrade completed. Current version is 17.8.2.
Show more breadcrumbs
PAPERMAN Charles
pysemigroup
Commits
69f609a4
Commit
69f609a4
authored
1 year ago
by
Charles Paperman
Browse files
Options
Downloads
Patches
Plain Diff
typing in progress, stuck on mutability of generic
parent
317350eb
No related branches found
No related tags found
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pysemigroup/automata.py
+161
-189
161 additions, 189 deletions
pysemigroup/automata.py
pysemigroup/types.py
+22
-0
22 additions, 0 deletions
pysemigroup/types.py
pysemigroup/views.py
+5
-5
5 additions, 5 deletions
pysemigroup/views.py
with
188 additions
and
194 deletions
pysemigroup/automata.py
+
161
−
189
View file @
69f609a4
This diff is collapsed.
Click to expand it.
pysemigroup/types.py
0 → 100644
+
22
−
0
View file @
69f609a4
from
typing
import
(
Callable
,
ClassVar
,
Generic
,
Hashable
,
Iterable
,
Iterator
,
Mapping
,
Optional
,
Self
,
Tuple
,
TypeAlias
,
TypeVar
,
overload
,
)
ViewEl
=
TypeVar
(
"
ViewEl
"
,
bound
=
Hashable
)
State
=
TypeVar
(
"
State
"
,
bound
=
Hashable
)
StateAlt
=
TypeVar
(
"
StateAlt
"
,
bound
=
Hashable
)
Symbol
=
TypeVar
(
"
Symbol
"
,
bound
=
Hashable
)
SymbolAlt
=
TypeVar
(
"
SymbolAlt
"
,
bound
=
Hashable
)
Transition
:
TypeAlias
[
State
,
Symbol
]
=
Tuple
[
State
,
Symbol
,
State
]
MarkerVar
=
TypeVar
(
"
MarkerVar
"
,
bound
=
Hashable
)
This diff is collapsed.
Click to expand it.
pysemigroup/views.py
+
5
−
5
View file @
69f609a4
...
...
@@ -4,9 +4,9 @@ from typing import (
Iterator
,
Self
,
)
from
pysemigroup.types
import
ViewEl
,
State
,
Symbol
class
View
(
frozenset
):
class
View
(
frozenset
[
ViewEl
]):
def
__repr__
(
self
):
return
f
"
{
self
.
__class__
.
__name__
}
(
{
self
.
subrepr
()
}
)
"
...
...
@@ -25,15 +25,15 @@ class View(frozenset):
yield
type
(
self
)(
S
.
union
((
el
,)))
class
StateView
(
View
):
class
StateView
(
View
[
State
]
):
...
class
Configuration
(
View
):
class
Configuration
(
View
[
State
]
):
...
class
AlphabetView
(
View
):
class
AlphabetView
(
View
[
Symbol
]
):
def
compute_salt
(
self
,
retry
=
4
):
salt
=
random
.
randint
(
0
,
MAX_INT
)
S
=
set
(
map
(
lambda
e
:
hash
((
e
,
salt
)),
self
))
...
...
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