[PATCH 5 of 9 yams] [refactoring] remove magic that could conflicted with IDE

Laurent Peuch cortex at worlddomination.be
Tue Jan 14 14:18:20 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 36e7d7d974d291c5e6855d273421db9183ea877a
# Parent  f362d81485067f7fc17e5b9f5a6f4942176cd113
# Available At https://hg.logilab.org/users/lpeuch/yams
#              hg pull https://hg.logilab.org/users/lpeuch/yams -r 36e7d7d974d2
[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
@@ -302,20 +302,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