[Python-Dev] Single- vs. Multi-pass iterability

Barry A. Warsaw barry@zope.com
2002年7月16日 10:30:51 -0400


>>>>> "AM" == Alex Martelli <aleax@aleax.it> writes:

 AM> Right -- "i inherit the implementation but none of the
 AM> interfaces". You can express this either by appropriately
 AM> tagging the "I inherit" part, as C++ does (private inheritance
 AM> -- the default, but that's yet _another_ C++ issue... defaults
 AM> that may or may not be appropriate for typical use!-), or with
 AM> a variation of "exclude-interfaces" however you spell that.
 AM> Alternatively, "I inherit" could default to "not the
 AM> interfaces", and, if needed, one might add a clause "oh, and
 AM> all the interfaces too, please" when that is positively
 AM> desired. Maybe the default would best be chosen on the basis
 AM> of "what is good for them" rather on "what appears most
 AM> desirable intuitively", as is currently done for module
 AM> imports.
I don't know, it seems like 6-one-way, half-dozen-the-other, but I
tend to agree with Guido on this one.
 AM> Defaulting to "i inherit all" is roughly as convenient as
 AM> defaulting to "from amodule import *" would be felt to be by
 AM> naive users unfamiliar with the issues of namespace pollution.
Interface conformance seems totally different than name importing, so
I don't think the analogy holds. I just feel that in Python, I rarely
use inheritance for implementation convenience only.
-Barry

AltStyle によって変換されたページ (->オリジナル) /