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

Laurent Peuch cortex at worlddomination.be
Wed Jan 15 10:58:32 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 24c5c0d26a555b43903352b2558baa9c1ed1a73c
# Parent  11e06f4b7337921f84cf338b81c532b8a546f7f6
# Available At https://hg.logilab.org/users/lpeuch/yams
#              hg pull https://hg.logilab.org/users/lpeuch/yams -r 24c5c0d26a55
[mypy] add type declaration for RichString

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