FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
sqlmodel/sqlmodel/default.py at main · MacroscopeBenchmark/sqlmodel · GitHub
MacroscopeBenchmark
sqlmodel
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
sqlmodel
/
sqlmodel
/
default.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (21 loc) · 850 Bytes
Breadcrumbs
sqlmodel
/
sqlmodel
/
default.py
Copy path
File metadata and controls
32 lines (21 loc) · 850 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
25
26
27
28
29
30
31
32
from
typing
import
Any
,
TypeVar
class
_DefaultPlaceholder
:
"""
You shouldn't use this class directly.
It's used internally to recognize when a default value has been overwritten, even
if the overridden default value was truthy.
"""
def
__init__
(
self
,
value
:
Any
):
self
.
value
=
value
def
__bool__
(
self
)
->
bool
:
return
bool
(
self
.
value
)
def
__eq__
(
self
,
o
:
object
)
->
bool
:
return
isinstance
(
o
,
_DefaultPlaceholder
)
and
o
.
value
==
self
.
value
_TDefaultType
=
TypeVar
(
"_TDefaultType"
)
def
Default
(
value
:
_TDefaultType
)
->
_TDefaultType
:
"""
You shouldn't use this function directly.
It's used internally to recognize when a default value has been overwritten, even
if the overridden default value was truthy.
"""
return
_DefaultPlaceholder
(
value
)
# type: ignore
Back
|
FazBrowse Home
|
New Git URL