Skip to content

Commit 97585d3

Browse files
author
Sylvain MARIE
committed
Minor: comments / docstring
1 parent e8f0832 commit 97585d3

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

valid8/base.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ def __init__(self, wrong_value, condition, **kwargs):
278278
they should subclass `ValidationFailed` instead of `Failure`. See `ValidationFailed` for details.
279279
"""
280280

281+
# We do not use slots otherwise `help_msg` cannot easily be overridden by a class attribute
282+
# __slots__ = 'wrong_value', validation_func', 'validation_outcome', 'append_details', 'context'
283+
281284
def __init__(self,
282285
wrong_value, # type: Any
283286
help_msg=None, # type: str
@@ -292,11 +295,11 @@ def __init__(self,
292295
293296
:param wrong_value: the value that was validated and failed validation
294297
:param help_msg: an optional help message specific to this failure. If not provided, the class attribute
295-
`help_msg` will be used. This behaviour may be redefined by subclasses by overriding `get_help_msg`
298+
`help_msg` will be used. This behaviour may be redefined by subclasses by overriding `get_help_msg`
296299
:param append_details: a boolean indicating if a default message containing the value should be appended to the
297300
string representation. Default is True
298301
:param kw_context_args: optional context (results, other) to store in this failure and that will be also used
299-
for help message formatting
302+
for help message formatting
300303
"""
301304

302305
self.append_details = append_details
@@ -305,7 +308,7 @@ def __init__(self,
305308
self.wrong_value = wrong_value
306309
self.__dict__.update(kw_context_args)
307310

308-
# store help_msg ONLY if non-None otherwise the (possibly user-overriden) class attribute should be left visible
311+
# store help_msg ONLY if non-None otherwise the (possibly user-overridden) class attribute should stay visible
309312
if help_msg is not None:
310313
self.help_msg = help_msg
311314

0 commit comments

Comments
 (0)