smartdict.py (13714:35636064b7a1) smartdict.py (13719:74853963ddcf)
1# Copyright (c) 2005 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 29 unchanged lines hidden (view full) ---

38# proxy class for values and overriding __nonzero__ on the proxy.
39# Everything else is just to (a) make proxies behave like normal
40# values otherwise, (b) make sure any dict operation returns a proxy
41# rather than a normal value, and (c) coerce values written to the
42# dict to be strings.
43
44from __future__ import print_function
45from __future__ import absolute_import
1# Copyright (c) 2005 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 29 unchanged lines hidden (view full) ---

38# proxy class for values and overriding __nonzero__ on the proxy.
39# Everything else is just to (a) make proxies behave like normal
40# values otherwise, (b) make sure any dict operation returns a proxy
41# rather than a normal value, and (c) coerce values written to the
42# dict to be strings.
43
44from __future__ import print_function
45from __future__ import absolute_import
46import six
47if six.PY3:
48 long = int
46
47from .convert import *
48from .attrdict import attrdict
49
50class Variable(str):
51 """Intelligent proxy class for SmartDict. Variable will use the
52 various convert functions to attempt to convert values to useable
53 types"""

--- 103 unchanged lines hidden ---
49
50from .convert import *
51from .attrdict import attrdict
52
53class Variable(str):
54 """Intelligent proxy class for SmartDict. Variable will use the
55 various convert functions to attempt to convert values to useable
56 types"""

--- 103 unchanged lines hidden ---