[PATCH 11 of 15 yams V3] [mypy] add type declaration for RichString

Laurent Peuch cortex at worlddomination.be
Wed Jan 15 20:59:11 CET 2020


# HG changeset patch
# User Laurent Peuch <cortex at worlddomination.be>
# Date 1579006065 -3600
#      Tue Jan 14 13:47:45 2020 +0100
# Node ID bed2125bff5538f5020719e5c512a085068252de
# Parent  19015dfae04bc1d435037fe4b2af83d80c860a8e
# Available At https://hg.logilab.org/users/lpeuch/yams
#              hg pull https://hg.logilab.org/users/lpeuch/yams -r bed2125bff55
[mypy] add type declaration for RichString

diff --git a/yams/buildobjs.py b/yams/buildobjs.py
--- a/yams/buildobjs.py
+++ b/yams/buildobjs.py
@@ -371,8 +371,9 @@ class Interval(AbstractTypedAttribute):
 
 
 # provides a RichString factory for convenience
-def RichString(default_format='text/plain', format_constraints=None, required=False, maxsize=None,
-               formula=MARKER, vocabulary=None, unique=None, override=False, **kwargs):
+def RichString(default_format: str = 'text/plain', format_constraints=None, required: bool = False,
+               maxsize: Optional[int] = None, formula=MARKER, vocabulary=None, unique=None,
+               override: bool = False, **kwargs):
     """RichString is a convenience attribute type for attribute containing text
     in a format that should be specified in another attribute.
 



More information about the cubicweb-devel mailing list