Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
typon-compiler
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
typon
typon-compiler
Commits
1a5bf295
Commit
1a5bf295
authored
Jul 07, 2023
by
Tom Niget
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add various functions to stdlib type hints
parent
be810856
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
trans/stdlib/__init__.py
trans/stdlib/__init__.py
+11
-1
No files found.
trans/stdlib/__init__.py
View file @
1a5bf295
...
@@ -36,6 +36,7 @@ class str:
...
@@ -36,6 +36,7 @@ class str:
def
__len__
(
self
)
->
int
:
...
def
__len__
(
self
)
->
int
:
...
def
__add__
(
self
,
other
:
Self
)
->
Self
:
...
def
__add__
(
self
,
other
:
Self
)
->
Self
:
...
def
__mul__
(
self
,
other
:
int
)
->
Self
:
...
def
__mul__
(
self
,
other
:
int
)
->
Self
:
...
def
startswith
(
self
,
prefix
:
Self
)
->
bool
:
...
assert
len
(
"a"
)
assert
len
(
"a"
)
...
@@ -50,14 +51,21 @@ class list(Generic[U]):
...
@@ -50,14 +51,21 @@ class list(Generic[U]):
def
__mul__
(
self
,
other
:
int
)
->
Self
:
...
def
__mul__
(
self
,
other
:
int
)
->
Self
:
...
def
__getitem__
(
self
,
index
:
int
)
->
U
:
...
def
__getitem__
(
self
,
index
:
int
)
->
U
:
...
def
__setitem__
(
self
,
index
:
int
,
value
:
U
)
->
None
:
...
def
pop
(
self
,
index
:
int
=
-
1
)
->
U
:
...
def
pop
(
self
,
index
:
int
=
-
1
)
->
U
:
...
def
__iter__
(
self
)
->
Iterator
[
U
]:
...
def
__iter__
(
self
)
->
Iterator
[
U
]:
...
def
__len__
(
self
)
->
int
:
...
def
__len__
(
self
)
->
int
:
...
def
append
(
self
,
value
:
U
)
->
None
:
...
assert
[
1
,
2
].
__iter__
()
assert
[
1
,
2
].
__iter__
()
assert
list
[
int
].
__iter__
assert
list
[
int
].
__iter__
class
dict
(
Generic
[
U
,
V
]):
def
__getitem__
(
self
,
key
:
U
)
->
V
:
...
def
__setitem__
(
self
,
key
:
U
,
value
:
V
)
->
None
:
...
def
__len__
(
self
)
->
int
:
...
assert
(
len
([
"a"
]))
assert
(
len
([
"a"
]))
...
@@ -107,8 +115,10 @@ assert lambda x: [x].__add__
...
@@ -107,8 +115,10 @@ assert lambda x: [x].__add__
assert
next
(
range
(
6
),
None
)
assert
next
(
range
(
6
),
None
)
class
file
:
class
file
:
def
read
(
self
)
->
Task
[
str
]:
...
def
read
(
self
,
size
:
int
=
0
)
->
Task
[
str
]:
...
def
close
(
self
)
->
Task
[
None
]:
...
def
close
(
self
)
->
Task
[
None
]:
...
def
__enter__
(
self
)
->
Self
:
...
def
__exit__
(
self
)
->
Task
[
bool
]:
...
def
open
(
filename
:
str
,
mode
:
str
)
->
Task
[
file
]:
...
def
open
(
filename
:
str
,
mode
:
str
)
->
Task
[
file
]:
...
...
...
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