[Python-3000] Discussions with no PEPs (original) (raw)
Barry Warsaw barry at python.org
Tue Mar 13 16:51:47 CET 2007
- Previous message: [Python-3000] Discussions with no PEPs
- Next message: [Python-3000] Discussions with no PEPs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Mar 13, 2007, at 11:06 AM, Phillip J. Eby wrote:
I prefer to think of adaptation as being a way to provide a namespace for generic functions. :)
See http://mail.python.org/pipermail/python-3000/2006-November/ 004717.html for an implementation of this idea. Basically, you define an interface by creating generic functions in the body of an 'Interface' subclass... and the resulting Interface can then be used to adapt any object to it. The 26 lines of code I gave can be used are not specific to any particular generic function implementation, so they could be used with simplegeneric, RuleDispatch, PEAK-Rules, Guido's prototype, or anything else you might come up with.
Interesting, and thanks for the links. I'm not 100% I got it all on
the first reading, but I think I see where you're going. I'm glad to
see my question is just plowing the same ground for the third tiem
(at least :).
One thing is still missing though, and that's the documentation
aspects of something like zope.interfaces. You could say that
generics.interfaces could just use docstrings, which is fine for
methods, but how would you document attributes in a discoverable way?
- -Barry
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin)
iQCVAwUBRfbIk3EjvBPtnXfVAQJroQQAuhxK74A2UKF2suwPPuO98ZG7LmEdPjX6 mS/R7grkFzCrWVlawM8DLYorI6dHh5I/5fKORSdrqqFDezNBysd3gGeyFNbe59Am AOt8MViPkVNtkA9GJvO3gGvy1tPYKdp1pd/0RDUeT01dYTEfARNsw0qsAOaiJ4tq w3ddavRf+0k= =6YUD -----END PGP SIGNATURE-----
- Previous message: [Python-3000] Discussions with no PEPs
- Next message: [Python-3000] Discussions with no PEPs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]