Marcin 'Qrczak' Kowalczyk wrote:
> "tomer filiba" <[EMAIL PROTECTED]> writes:
>
>> one thing that worries me with generic methods is, they would
>> dispatch based on types... which means my proxies would all break.
>> please, think of the proxies! ;)
>
> OTOH proxies generated by my Python<->Kogut bridge would break if
> hasattr was used to determine interfaces. For example if obj is a
> Kogut object wrapped in a Python object, then obj.__iter__ always
> succeeds, but calling the resulting function fails if the underlying
> object doesn't actually support iteration.
>
> (Types aren't currently reflected either, so type-based interface
> discovery would fail too, but I plan to change that.)
When you change type-based checks to work, you can make the rest of the slots
work properly too by generating wrapper types on the fly (i.e., generator a
type proxy as well as an instance proxy - you can use a type proxy cache do
avoid creating new ones all the time).
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com