[PATCH 9 of 9 yams] [mypy] add type declaration for RichString

Laurent Peuch cortex at worlddomination.be
Tue Jan 14 14:18:24 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 ebbb7ae9e31c31ed757c1e3718d35215a86702e3
# Parent  ba2356e331e41bce9f8698c0c2b90e580b6b1a07
# Available At https://hg.logilab.org/users/lpeuch/yams
#              hg pull https://hg.logilab.org/users/lpeuch/yams -r ebbb7ae9e31c
[mypy] add type declaration for RichString

diff --git a/yams/buildobjs.py b/yams/buildobjs.py
--- a/yams/buildobjs.py
+++ b/yams/buildobjs.py
@@ -361,8 +361,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