Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dabeaz-course/python-mastery
/ check
Method
check
Solutions/7_2/validate.py:36–39 ·
view source on GitHub ↗
(cls, value)
Source
from the content-addressed store, hash-verified
34
class
Positive(Validator):
35
@classmethod
36
def
check(cls, value):
37
if
value < 0:
38
raise
ValueError(
'must be >= 0'
)
39
return
super().check(value)
40
41
class
NonEmpty(Validator):
42
@classmethod
Callers
nothing calls this directly
Calls
1
check
Method · 0.45
Tested by
no test coverage detected