-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Philipp von Weitershausen wrote:
> Chris Withers wrote:
>> Can a named adapter find out the name it was registered with during the 
>> adaptation process?
> 
> Nope.

But you can create the adapter factories in such a way that they know
that name, via a little "curry powder":

  >>> map = {}
  >>> for name in 'foo', 'bar', 'baz':
  ...     def whoami(name=name):
  ...         return name
  ...     map[name] = whoami
  ...
  >>> map['foo']()
  'foo'
  >>> map['bar']()
  'bar'



Tres.
- --
===================================================================
Tres Seaver          +1 202-558-7113          [EMAIL PROTECTED]
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFXRsj+gerLs4ltQ4RAtHSAKC85EasxcDQpCTDaY7AGT2lHpP7egCeJ12k
qaUxJBox8tQ1Pz5LWw99IHk=
=zgNn
-----END PGP SIGNATURE-----

_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to