Commit 5bc8cf14 authored by Jim Fulton's avatar Jim Fulton

additions based on 0.1 comments

parent 4eeae24e
Interface package change history
Release 0.1.1
This release includes some changes to the documentation to reflect
comments made on 0.1.
Release 0.1
This was the initial release.
...@@ -245,7 +245,14 @@ Details ...@@ -245,7 +245,14 @@ Details
Tim Peter's has expressed the desire to provide abstract Tim Peter's has expressed the desire to provide abstract
implementations in an interface definitions, where, presumably, an implementations in an interface definitions, where, presumably, an
abstract implementation uses only features defined by the abstract implementation uses only features defined by the
interface. For example: 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
if I cheat and sniff at method bytecodes.
For example:
class ListInterface(Interface.Standard.MutableSequence): class ListInterface(Interface.Standard.MutableSequence):
...@@ -256,10 +263,14 @@ Details ...@@ -256,10 +263,14 @@ Details
"add a value to the end of the object" "add a value to the end of the object"
self.append(v) self.append(v)
Perhaps if a method definition has a body (other than a doc ListBase=ListInterface.defered()
string) then the corresponding method in the defered class
will not be defered. This would not be hard to do in CPython class ListImplementer(Listbase):
if I cheat and sniff at method bytecodes. def append(self, v): ...
In this example, we can create a base class, ListBase, that provides an
abstract implementation of 'push' and an implementation of append
that raises an error if not overridden.
Standard interfaces Standard interfaces
...@@ -279,9 +290,6 @@ Details ...@@ -279,9 +290,6 @@ Details
type(1L), type(1L),
(AbritraryPrecision, BitNumber, Signed)) (AbritraryPrecision, BitNumber, Signed))
Issues Issues
o What should the objects that define attributes look like? o What should the objects that define attributes look like?
...@@ -291,6 +299,10 @@ Issues ...@@ -291,6 +299,10 @@ Issues
Note that we've made a first cut with 'Attribute' and Note that we've made a first cut with 'Attribute' and
'Method' objects. 'Method' objects.
Note that the information contained in a non-method attribute
object might contain the attribute value's interface as well as
other information, such as an attribute's usage.
o There are places in the current implementation that use o There are places in the current implementation that use
'isinstance' that should be changed to use interface 'isinstance' that should be changed to use interface
checks. checks.
......
...@@ -12,7 +12,7 @@ for f in `cat pyfiles`; do ...@@ -12,7 +12,7 @@ for f in `cat pyfiles`; do
cp $f "$M-$R/Interface/" cp $f "$M-$R/Interface/"
done done
for f in README.txt test.py; do for f in README.txt CHANGES.txt test.py; do
cp $f "$M-$R/" cp $f "$M-$R/"
done done
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment