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
5f0d8e2d
Commit
5f0d8e2d
authored
Aug 30, 2000
by
Shane Hathaway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correction of misspelled "deferred".
parent
49a5b75f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
lib/python/Interface/README.txt
lib/python/Interface/README.txt
+8
-8
lib/python/Interface/iclass.py
lib/python/Interface/iclass.py
+4
-4
lib/python/Interface/test.py
lib/python/Interface/test.py
+1
-1
No files found.
lib/python/Interface/README.txt
View file @
5f0d8e2d
...
...
@@ -30,7 +30,7 @@ Basic assumptions:
o You cannot mix interfaces and classes in base-class lists.
There are utilities and methods for computing implied interfaces
from classes and for computing "defered" classes from interfaces.
from classes and for computing "defer
r
ed" classes from interfaces.
Why aren't interface classes? Interfaces perform a different
function that classes. Classes are for sharing implementation.
...
...
@@ -219,10 +219,10 @@ Details
It is my expectation that Attribute objects will eventually be
able to provide all sorts of interesting meta-data.
Defered classes
Defer
r
ed classes
You cannot use interfaces as base classes. You can, however,
create "defered" classes from an interface:
create "defer
r
ed" classes from an interface:
class StackInterface(Interface.Base):
...
...
@@ -232,12 +232,12 @@ Details
def pop(self):
"Remove and return an object from the top of the stack"
class Stack(StackInterface.defered()):
class Stack(StackInterface.defer
r
ed()):
"This is supposed to implement a stack"
__implements__=StackInterface
Attempts to call methods inherited from a defered class will
Attempts to call methods inherited from a defer
r
ed class will
raise Interface.BrokenImplementation exceptions.
Trial baloon: abstract implementations
...
...
@@ -248,8 +248,8 @@ Details
interface.
Perhaps if a method definition has a body (other than a doc
string) then the corresponding method in the defered class
will not be defered. This would not be hard to do in CPython
string) then the corresponding method in the defer
r
ed class
will not be defer
r
ed. This would not be hard to do in CPython
if I cheat and sniff at method bytecodes.
For example:
...
...
@@ -263,7 +263,7 @@ Details
"add a value to the end of the object"
self.append(v)
ListBase=ListInterface.defered()
ListBase=ListInterface.defer
r
ed()
class ListImplementer(Listbase):
def append(self, v): ...
...
...
lib/python/Interface/iclass.py
View file @
5f0d8e2d
...
...
@@ -47,10 +47,10 @@ class Interface:
raise
Exceptions
.
InvalidInterface
(
"Concrete attribute, %s"
%
k
)
def
defered
(
self
):
"""Return a defered class corresponding to the interface
def
defer
r
ed
(
self
):
"""Return a def
r
ered class corresponding to the interface
"""
if
hasattr
(
self
,
"_defer
ed"
):
return
self
.
_defe
red
if
hasattr
(
self
,
"_defer
red"
):
return
self
.
_defer
red
klass
=
{}
exec
"class %s: pass"
%
self
.
__name__
in
klass
...
...
@@ -58,7 +58,7 @@ class Interface:
self
.
__d
(
klass
.
__dict__
)
self
.
_defered
=
klass
self
.
_defer
r
ed
=
klass
return
klass
...
...
lib/python/Interface/test.py
View file @
5f0d8e2d
...
...
@@ -28,7 +28,7 @@ class I3(Interface.Base): pass
class
I4
(
Interface
.
Base
):
pass
class
A
(
I1
.
defered
()):
class
A
(
I1
.
defer
r
ed
()):
__implements__
=
I1
class
B
:
...
...
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