FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
typeshed/stdlib/string/templatelib.pyi at main · python/typeshed · GitHub
python
typeshed
Repository navigation
Code
Issues
206
(206)
Pull requests
204
(204)
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
typeshed
/
stdlib
/
string
/
templatelib.pyi
Copy path
More file actions
More file actions
Latest commit
History
History
History
36 lines (29 loc) · 1.27 KB
Breadcrumbs
typeshed
/
stdlib
/
string
/
templatelib.pyi
Copy path
File metadata and controls
36 lines (29 loc) · 1.27 KB
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
25
26
27
28
29
30
31
32
33
34
35
36
from
collections
.
abc
import
Iterator
from
types
import
GenericAlias
from
typing
import
Any
,
Generic
,
Literal
,
TypeVar
,
final
,
overload
_T
=
TypeVar
(
"_T"
)
@
final
class
Template
:
# TODO: consider making `Template` generic on `TypeVarTuple`
strings
:
tuple
[
str
, ...]
interpolations
:
tuple
[
Interpolation
[
Any
], ...]
def
__new__
(
cls
,
*
args
:
str
|
Interpolation
[
Any
])
->
Template
: ...
def
__iter__
(
self
)
->
Iterator
[
str
|
Interpolation
[
Any
]]: ...
def
__add__
(
self
,
other
:
Template
,
/
)
->
Template
: ...
def
__class_getitem__
(
cls
,
item
:
Any
,
/
)
->
GenericAlias
: ...
@
property
def
values
(
self
)
->
tuple
[
Any
, ...]: ...
# Tuple of interpolation values, which can have any type
@
final
class
Interpolation
(
Generic
[
_T
]):
value
:
_T
expression
:
str
conversion
:
Literal
[
"a"
,
"r"
,
"s"
]
|
None
format_spec
:
str
__match_args__
=
(
"value"
,
"expression"
,
"conversion"
,
"format_spec"
)
def
__new__
(
cls
,
value
:
_T
,
expression
:
str
=
""
,
conversion
:
Literal
[
"a"
,
"r"
,
"s"
]
|
None
=
None
,
format_spec
:
str
=
""
)
->
Interpolation
[
_T
]: ...
def
__class_getitem__
(
cls
,
item
:
Any
,
/
)
->
GenericAlias
: ...
@
overload
def
convert
(
obj
:
_T
,
/
,
conversion
:
None
)
->
_T
: ...
@
overload
def
convert
(
obj
:
object
,
/
,
conversion
:
Literal
[
"r"
,
"s"
,
"a"
])
->
str
: ...
Back
|
FazBrowse Home
|
New Git URL