~ubuntu-branches/debian/sid/pyx/sid

« back to all changes in this revision

Viewing changes to pyx/attr.py

  • Committer: Bazaar Package Importer
  • Author(s): Stuart Prescott
  • Date: 2011-05-20 00:13:52 UTC
  • mto: (9.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20110520001352-odcuqpdezuusbbw1
Tags: upstream-0.11.1
Import upstream version 0.11.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- coding: ISO-8859-1 -*-
2
 
#
3
 
#
4
 
# Copyright (C) 2003-2004 J�rg Lehmann <joergl@users.sourceforge.net>
 
1
# -*- encoding: utf-8 -*-
 
2
#
 
3
#
 
4
# Copyright (C) 2003-2004 Jörg Lehmann <joergl@users.sourceforge.net>
5
5
# Copyright (C) 2003-2004 Michael Schindler <m-schindler@users.sourceforge.net>
6
 
# Copyright (C) 2003-2004 Andr� Wobst <wobsta@users.sourceforge.net>
 
6
# Copyright (C) 2003-2004 André Wobst <wobsta@users.sourceforge.net>
7
7
#
8
8
# This file is part of PyX (http://pyx.sourceforge.net/).
9
9
#
21
21
# along with PyX; if not, write to the Free Software
22
22
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
23
23
 
24
 
# check for an isinstance which accepts both a class and a sequence of classes
25
 
# as second argument and emulate this behaviour if necessary
26
 
try:
27
 
    isinstance(1, (int, float))
28
 
except TypeError:
29
 
    # workaround for Python 2.1
30
 
    _isinstance = isinstance
31
 
    def isinstance(instance, clsarg):
32
 
        import types
33
 
        if _isinstance(clsarg, types.ClassType):
34
 
            return _isinstance(instance, clsarg)
35
 
        for cls in clsarg:
36
 
            if _isinstance(instance, cls):
37
 
                return 1
38
 
        return 0
39
 
 
40
24
#
41
25
# some helper functions for the attribute handling
42
26
#