Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/psqlparse-1.0rc7-py3.11-linux-x86_64.egg/psqlparse/nodes/value.py: 75%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

32 statements  

1import abc 

2 

3 

4class Value(object): 

5 __metaclass__ = abc.ABCMeta 

6 

7 def __str__(self): 

8 return str(self.val) 

9 

10 @abc.abstractproperty 

11 def val(self): 

12 pass 

13 

14 

15class Integer(Value): 

16 

17 def __init__(self, obj): 

18 self.ival = obj.get('ival') 

19 

20 def __int__(self): 

21 return self.ival 

22 

23 @property 

24 def val(self): 

25 return self.ival 

26 

27 

28class String(Value): 

29 

30 def __init__(self, obj): 

31 self.str = obj.get('str') 

32 

33 @property 

34 def val(self): 

35 return self.str 

36 

37 

38class Float(Value): 

39 

40 def __init__(self, obj): 

41 self.str = obj.get('str') 

42 self.fval = float(self.str) 

43 

44 def __float__(self): 

45 return self.fval 

46 

47 @property 

48 def val(self): 

49 return self.fval