Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
38827f1f
Commit
38827f1f
authored
Jun 10, 2002
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made the Interface package work with the combination of Python 2.2 and
ExtensionClass.
parent
6b646873
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
23 deletions
+20
-23
lib/python/Interface/_object.py
lib/python/Interface/_object.py
+20
-23
No files found.
lib/python/Interface/_object.py
View file @
38827f1f
...
...
@@ -13,7 +13,7 @@
##############################################################################
"""Provide a halfway believable rendition of Python 2.2's object
$Id: _object.py,v 1.
2 2002/06/07 17:18:29 jim
Exp $
$Id: _object.py,v 1.
3 2002/06/10 20:15:14 shane
Exp $
"""
class
_x
:
...
...
@@ -22,41 +22,38 @@ class _x:
ClassTypes
=
(
type
(
_x
),
)
MethodTypes
=
(
type
(
_x
.
m
),
)
isInstance
=
isinstance
try
:
object
except
NameError
:
# Python 2.1
try
:
from
ExtensionClass
import
Base
as
object
except
ImportError
:
# Python 2.1 wo ExtensionClass
class
object
:
pass
else
:
# Python 2.2
ClassTypes
+=
(
type
,
)
object
=
object
else
:
# Python 2.1 w ExtensionClass
try
:
import
ExtensionClass
except
ImportError
:
# ExtensionClass is not present
pass
else
:
# ExtensionClass is present
def
isInstance
(
ob
,
klass
):
if
type
(
type
(
ob
))
is
type
(
klass
):
return
isinstance
(
ob
,
klass
)
return
0
class
_x
(
object
):
class
_x
(
ExtensionClass
.
Base
):
def
m
(
self
):
pass
ClassTypes
+=
(
type
(
_x
),
)
MethodTypes
+=
(
type
(
_x
.
m
),
)
else
:
# Python 2.2
ClassTypes
+=
(
type
,
)
object
=
object
isinstance
=
isinstance
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment