+1 Excellent Change
+1 Minimal Backward Compatibility Difficulties
I think this would also help quite a bit with newbie adoption of Python.
I've had to explain this un-feature on numerous occassions and it given
how smart Python is, I've wondered why it has this requirement. If you
look in vario
Interesting discussion. I've been thinking the opposite; that I should
start using __attribute more often for "undocumented, private" member
variables that are implementation details and clearly not part of the
public interface.
I'm curious what people have against it?
On Sun, Dec 11, 2005 at 09
sticky, then a call
to adapt() will first check to see if a given adapter (keyed
by protocol) has been created for the adaptee; if so, then
that adapter is returned, otherwise the factory is asked to
produce an adapter and that adapter is cashed.
feedback:
Is this use
On Fri, Jan 14, 2005 at 10:02:39AM -0800, Michel Pelletier wrote:
| Phillip J. Eby wrote:
| > The result is that you generate a simple adapter class whose
| > only state is a read-only slot pointing to the adapted object,
| > and descriptors that bind the registered implementations to that object.
On Fri, Jan 14, 2005 at 12:28:16PM -0500, Phillip J. Eby wrote:
| At 08:32 AM 1/14/05 -0800, Guido van Rossum wrote:
| >I have no desire to add syntax
| >complexities like this to satisfy some kind of theoretically nice
| >property.
|
| Whether it's syntax or a decorator, it allows you to create s
On Fri, Jan 14, 2005 at 04:39:00PM +, Armin Rigo wrote:
| I'm trying to reserve the usage of "interface" to something more
| concrete: the concrete ways we have to manipulate a given object
| (typically a set of methods including some unwritten expectations).
I'd say that a programmer inte
; registeries instead of the single global one, to avoid
| all kinds of unexpected global effects.
Nice...
Best,
Clark
--
Clark C. Evans Prometheus Research, LLC.
http://www.prometheusresearch.com/
o
decorator syntax:
@adapt(x, Y, **properties)
I hope this helps.
P.S. Clearly there is much of information to be captured in this
thread and put into the PEP (mostly as appendix material); keep
posting good ideas, problems, opinions, whatever -- I will summarize
over this weekend.
--
Clark
On Thu, Jan 13, 2005 at 08:54:33PM -0500, Raymond Hettinger wrote:
| > Since __conform__ and __adapt__
| > would sprout two new arguments, it would make those writing adapters
| > think a bit more about the kind of adapter that they are providing.
|
| Using optional arguments may not be the most e
On Thu, Jan 13, 2005 at 11:50:37PM -0500, Phillip J. Eby wrote:
| 'lossless' isn't really a good term for non-noisy. The key is that a
| "noisy" adapter is one that alters the precision of the information it
| provides, by either claiming greater precision than is actually present,
| or by losi
On Thu, Jan 13, 2005 at 08:08:43PM -0500, Bob Ippolito wrote:
| >Ok. I think we have identified two sorts of restrictions on the
| >sorts of adaptations one may want to have:
| >
| > `stateless' the adaptation may only provide a result which
| > does not maintain its own state
| >
adaptations which were not stateless and lossless
would not be used (by default) in an automatic adapter construction.
Your thoughts?
Clark
--
Clark C. Evans Prometheus Research, LLC.
http://www.prometheusresearch.com/
re you willing to do that round of editing to PEP 246...? I'll
| >| then to the NEXT one which will still undoubtedly be needed...
| >
| >I could make a wack at it this weekend.
|
| Great! I assume you have copies of all relevant mails since they all
| went around th
On Thu, Jan 13, 2005 at 06:27:08PM +0100, Alex Martelli wrote:
| >The 'implicit' adaptation refers to the automagical construction of
| >composite adapters assuming that a 'transitive' property holds. I've
| >seen nothing in this thread to explain why this is so valueable, why
|
| Let me play dev
ombined adapters easily.
On Wed, Jan 12, 2005 at 02:57:11PM -0500, Clark C. Evans wrote:
| On Wed, Jan 12, 2005 at 10:16:14AM -0800, Guido van Rossum wrote:
| | But now, since I am still in favor of automatic "combined" adaptation
| | *as a last resort*
A few problems with automatic &qu
be checking for inheritance - the adaptation machinery or the __conform__
| method.
Correct. I think either method is OK, and perfer Phillip's approach.
Best,
Clark
--
Clark C. Evans Prometheus Research, LLC.
ht
ink this is similar to where implicit type
| conversions in C++ go wrong, and to the extent that PEP 246 aligns with
| those. . . *shudder*.
PEP 246 doesn't align at all with this problem.
Best,
Clark
--
Clark C. Evans Prometheus Research, LLC.
the context of PEP 246, because interfaces aren't
| defined there. So PEP 246 can't make a clear statement about
| transitivity, precisely because it doesn't define interfaces. But does
| this harm PEP 246? I'm not sure.
Well, PEP 246 should be edited, IMHO, t
Phillip,
In my mind, the driving use-case for PEP 246 was to allow causual
programmers to plug components together and have it 'just work'; it
does this by enabling the component vendors to carry on a discussion
via __adapt__ and __conform__ to work together. I was not picturing
that your average
On Wed, Jan 12, 2005 at 04:07:37PM -0600, Ian Bicking wrote:
| A two-step adaptation encodes specific intention that it seems transitive
| adaption would be blind to.
Exactly. Nice example Ian. To parrot your example a bit more
concretely, the problem happens when you get two different
adaptati
On Wed, Jan 12, 2005 at 10:16:14AM -0800, Guido van Rossum wrote:
| But now, since I am still in favor of automatic "combined" adaptation
| *as a last resort*, I ask you to consider that Python is not C++, and
| that perhaps we can make the experience in Python better than it was
| in C++. Perhaps
s case, None is
the better choice for this particular case since it would enable
third-parties to register a wrapper.
Overall, I think both you and Alex are now proposing essentially
the same thing... no?
Best,
Clark
--
Clark C. Evans Prom
s, not adapter
| composition
It'd be nice if interfaces had a way to specify a test-suite that
could be run against a component which claims to be compliant. For
example, it could provide invalid inputs and assert that the proper
errors are returned, etc.
Best,
Clark
--
Clark C. Evans
On Mon, Jan 10, 2005 at 01:34:59PM -0500, Phillip J. Eby wrote:
| The performance penalty I was talking about was for using an abstract
| base class, in a subclass with a __conform__ method for conformance to
| other protocols. In this case, __conform__ will be uselessly called
| every time the
Alex,
This is wonderful work, thank you for keeping the ball in the air;
I'm honored to keep my name as a co-author -- kinda like a free lunch.
Phillip,
Once again, thank you! Without PyProtocols and your advocacy,
this proposal might have been buried in the historical bit-bucket.
On M
25 matches
Mail list logo