Raphael Ritz wrote:
Chris Withers schrieb:
Tres Seaver wrote:
[..]
...and yet it works fine in Zope 2.9.4 :-S
The first 'provideAdapter' call raises an exeption because 'str' doesn't
have an '__iro__'.
I don't even know what an __iro__ is :-S
Interface Resolution Order - I think at l
Dieter Maurer wrote:
As Chris example demonstrates, it would have been better
to call "IZopeDublinCore(myobj)" the "IZopeDublinCore"
adaptation of "myobj".
Agreed, and would have saved me a lot of confusion.
cheers,
Chris
--
Simplistix - Content Management, Zope & Python Consulting
Jean-Marc Orliaguet wrote at 2006-11-15 20:51 +0100:
> ...
>but what problem is all this supposed to solve? are you guys writing a
>PhD or something .-) ?
Well chosen terminology is a key to understanding.
Therefore, it is justified to discuss about it.
--
Dieter
__
Philipp von Weitershausen wrote at 2006-11-15 21:11 +0100:
> ...
>Not sure what "official" terminology glossary you're basing this on
I am basing this on the meaning of english words.
An adapter is something that adapts (and not something that is adapted).
"adapt" is a transitive verb. It applie
Chris Withers wrote:
Philipp von Weitershausen wrote:
Not sure what "official" terminology glossary you're basing this on,
but we often refer to "IZopeDublinCore(myobj)" as the "IZopeDublinCore
adapter" of myobj". Whatever is called to instantiate that object we
call the "adapter factory" or
Jean-Marc Orliaguet wrote:
once you have that utility / adapter you should be able to call it like:
converter = getAdapterFor(123, type=IToStringConverter)
strResult = converter.convert(123)
Not quite, what I'm looking to do is more along the lines of:
mystr = getAdapter(123,str)
(where
Philipp von Weitershausen wrote:
>>> IZopeDublinCore(obj)
is a flexible version of
>>> ZDCAnnotatableAdapter(obj)
Flexible, because a different implementation that ZDCAnnotatableAdapter
might be used. That's dispatched through the adapter registry.
Right, exactly.
IZopeDublinCore(myobj
Philipp von Weitershausen wrote:
Not sure what "official" terminology glossary you're basing this on, but
we often refer to "IZopeDublinCore(myobj)" as the "IZopeDublinCore
adapter" of myobj". Whatever is called to instantiate that object we
call the "adapter factory" or "adapter implementatio
Jean-Marc Orliaguet wrote:
str(123) has the same syntax as IZopeDublinCore(myobj), but semantically
there is nothing in common between the two expressions.
I disagree.
>>> IZopeDublinCore(obj)
is a flexible version of
>>> ZDCAnnotatableAdapter(obj)
Flexible, because a different implemen
Philipp von Weitershausen wrote:
Dieter Maurer wrote:
Philipp von Weitershausen wrote at 2006-11-15 20:34 +0100:
Dieter Maurer wrote:
Philipp von Weitershausen wrote at 2006-11-15 15:08 +0100:
...
def myStrAdapter(something):
return str(something)
It instantiates a 'str' object. The 'str'
Dieter Maurer wrote:
Philipp von Weitershausen wrote at 2006-11-15 20:34 +0100:
Dieter Maurer wrote:
Philipp von Weitershausen wrote at 2006-11-15 15:08 +0100:
...
def myStrAdapter(something):
return str(something)
It instantiates a 'str' object. The 'str' object is the adapter for
'somet
Philipp von Weitershausen wrote:
Dieter Maurer wrote:
Philipp von Weitershausen wrote at 2006-11-15 15:08 +0100:
...
def myStrAdapter(something):
return str(something)
It instantiates a 'str' object. The 'str' object is the adapter for
'something'.
Huh? This would be a severe terminology
Philipp von Weitershausen wrote at 2006-11-15 20:34 +0100:
>Dieter Maurer wrote:
>> Philipp von Weitershausen wrote at 2006-11-15 15:08 +0100:
>>> ...
def myStrAdapter(something):
return str(something)
>>> It instantiates a 'str' object. The 'str' object is the adapter for
>>> 'someth
Dieter Maurer wrote:
Philipp von Weitershausen wrote at 2006-11-15 15:08 +0100:
...
def myStrAdapter(something):
return str(something)
It instantiates a 'str' object. The 'str' object is the adapter for
'something'.
Huh? This would be a severe terminology abuse:
I agree, it's bending th
Philipp von Weitershausen wrote at 2006-11-15 15:08 +0100:
> ...
>> def myStrAdapter(something):
>>return str(something)
>It instantiates a 'str' object. The 'str' object is the adapter for
>'something'.
Huh? This would be a severe terminology abuse:
An adapter should adapt something to so
Chris Withers wrote:
Philipp von Weitershausen wrote:
...hence the quotes. It's a "function" in that I want to use it as an
adapter that doesn't need to be instantiated by a factory before
being used.
All adapters need to be instantiated.
Why?
def myStrAdapter(something):
return str(s
Chris Withers wrote:
>
> Philipp von Weitershausen wrote:
>
>>> ...hence the quotes. It's a "function" in that I want to use it as an
>>> adapter that doesn't need to be instantiated by a factory before being
>>> used.
>>
>> All adapters need to be instantiated.
>
> Why?
>
> def myStrAda
Philipp von Weitershausen wrote:
...hence the quotes. It's a "function" in that I want to use it as an
adapter that doesn't need to be instantiated by a factory before being
used.
All adapters need to be instantiated.
Why?
def myStrAdapter(something):
return str(something)
This functi
Chris Withers wrote:
Philipp von Weitershausen wrote:
Chris Withers wrote:
Christian Theune wrote:
The problem you have is to provide a specification for the 'str'
interface.
There are a couple of problems here...
1. str is both a "function" and a "class"
Nope. It's a class since Python 2
whit wrote:
hello RuleDispatch...
What's RuleDispatch?
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/opt
Philipp von Weitershausen wrote:
Chris Withers wrote:
Christian Theune wrote:
The problem you have is to provide a specification for the 'str'
interface.
There are a couple of problems here...
1. str is both a "function" and a "class"
Nope. It's a class since Python 2.2.
...hence the quo
Christian Theune wrote:
The problem you have is to provide a specification for the 'str' interface.
There are a couple of problems here...
1. str is both a "function" and a "class"
2. I was to register the "function" str as an adapter for, say, the
"class" int to the "class" str, so there's
Morning,
Rocky Burt wrote:
> On Fri, 2006-10-11 at 08:00 +, Chris Withers wrote:
>> This is a toy example, but I need to do something similar and can't seem
>> to get the registration right...
>>
>> How can I register the str builtin as an adapter from python int objects
>> to python str obj
23 matches
Mail list logo