Package mvpa :: Package support :: Module copy
[hide private]
[frames] | no frames]

Source Code for Module mvpa.support.copy

 1  #emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*- 
 2  #ex: set sts=4 ts=4 sw=4 et: 
 3  ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## 
 4  # 
 5  #   See COPYING file distributed along with the PyMVPA package for the 
 6  #   copyright and license terms. 
 7  # 
 8  ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## 
 9  """Support for python's copy module. 
10   
11  """ 
12   
13  __docformat__ = 'restructuredtext' 
14   
15  import sys 
16   
17  # We have to use deepcopy from python 2.5, since otherwise it fails to 
18  # copy sensitivity analyzers with assigned combiners which are just 
19  # functions not functors 
20  if sys.version_info[0] > 2 or sys.version_info[1] > 4: 
21      # little trick to be able to import 'copy' package (which has same name) 
22      oldname = __name__ 
23      # crazy name with close to zero possibility to cause whatever 
24      __name__ = 'iaugf9zrkjsbdv8' 
25      from copy import copy, deepcopy 
26      # restore old settings 
27      __name__ = oldname 
28  else: 
29      from mvpa.support._copy import copy, deepcopy 
30