[PATCH 07 of 15 yams V3] [refactoring] remove magic that could conflicted with IDE

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


# HG changeset patch
# User Laurent Peuch <cortex at worlddomination.be>
# Date 1578660080 -3600
#      Fri Jan 10 13:41:20 2020 +0100
# Node ID fd0474e35c114383a8d659af2758a4eb1639701d
# Parent  1ba418b4b80a620e27dda5d05bd2ac2ef66a2efa
# Available At https://hg.logilab.org/users/lpeuch/yams
#              hg pull https://hg.logilab.org/users/lpeuch/yams -r fd0474e35c11
[refactoring] remove magic that could conflicted with IDE

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



More information about the cubicweb-devel mailing list