[PATCH 09 of 15 yams V3] [mypy] type all class.etype of all AbstractTypedAttribute subclasses

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


# HG changeset patch
# User Laurent Peuch <cortex at worlddomination.be>
# Date 1579005268 -3600
#      Tue Jan 14 13:34:28 2020 +0100
# Node ID 3dce73d580f5acb5dfaf31f55e02a704cd2a1e19
# Parent  12faa3344fd71074ecd45b0a1e3c1737cc8abaf0
# Available At https://hg.logilab.org/users/lpeuch/yams
#              hg pull https://hg.logilab.org/users/lpeuch/yams -r 3dce73d580f5
[mypy] type all class.etype of all AbstractTypedAttribute subclasses

diff --git a/yams/buildobjs.py b/yams/buildobjs.py
--- a/yams/buildobjs.py
+++ b/yams/buildobjs.py
@@ -313,59 +313,59 @@ def make_type(etype):
 
 # build a specific class for each base type
 class String(AbstractTypedAttribute):
-    etype = 'String'
+    etype: str = 'String'
 
 
 class Password(AbstractTypedAttribute):
-    etype = 'Password'
+    etype: str = 'Password'
 
 
 class Bytes(AbstractTypedAttribute):
-    etype = 'Bytes'
+    etype: str = 'Bytes'
 
 
 class Int(AbstractTypedAttribute):
-    etype = 'Int'
+    etype: str = 'Int'
 
 
 class BigInt(AbstractTypedAttribute):
-    etype = 'BigInt'
+    etype: str = 'BigInt'
 
 
 class Float(AbstractTypedAttribute):
-    etype = 'Float'
+    etype: str = 'Float'
 
 
 class Boolean(AbstractTypedAttribute):
-    etype = 'Boolean'
+    etype: str = 'Boolean'
 
 
 class Decimal(AbstractTypedAttribute):
-    etype = 'Decimal'
+    etype: str = 'Decimal'
 
 
 class Time(AbstractTypedAttribute):
-    etype = 'Time'
+    etype: str = 'Time'
 
 
 class Date(AbstractTypedAttribute):
-    etype = 'Date'
+    etype: str = 'Date'
 
 
 class Datetime(AbstractTypedAttribute):
-    etype = 'Datetime'
+    etype: str = 'Datetime'
 
 
 class TZTime(AbstractTypedAttribute):
-    etype = 'TZTime'
+    etype: str = 'TZTime'
 
 
 class TZDatetime(AbstractTypedAttribute):
-    etype = 'TZDatetime'
+    etype: str = 'TZDatetime'
 
 
 class Interval(AbstractTypedAttribute):
-    etype = 'Interval'
+    etype: str = 'Interval'
 
 
 # provides a RichString factory for convenience



More information about the cubicweb-devel mailing list