> Asking Questions About Roles

Shouldn't there be some way to ``revoke'' roles?

How can we get a list of all roles played by an object?

Should there be a way to check ``loosely'' whether an object can
potentially play a given role? (i.e., checking whether an object
provides a give interface, atleast syntactically)

I understand that this can be achieved via:

try:
      now_performs(instance.__class__, [role.RoleToCheck])
except:
      print("can't play role")
else:
      print("maybe plays role")

But such approach will be error prone (``revoking'' roles later, and
such; destructive checks are bad idea, anyway). Better would be to
have::

if performs(instance, [role.RoleToCheck], loose=True):
      print("maybe plays role")


> Assigning Roles at Runtime

Maybe it should be suggested that dynamic role assignment should not
be made without knowing the implementation (with a reminder about
tree's bark() and dog's bark() ).


Regards,
Arvind
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to