[PATCH 7 of 9 yams V2] [mypy] type all class.etype of all AbstractTypedAttribute subclasses

Laurent Peuch cortex at worlddomination.be
Wed Jan 15 10:58:30 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 a7dc4c1aeca3e4fc10e6c3cc837ad8a685bc0232
# Parent  3077c65fe49c32965897db802b2cc80a4da3ecb5
# Available At https://hg.logilab.org/users/lpeuch/yams
#              hg pull https://hg.logilab.org/users/lpeuch/yams -r a7dc4c1aeca3
[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
@@ -314,59 +314,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