The primary purpose of the proposed feature is to get a safe way to ask whether given object "o" truely has attribute "a" i.e. does not acquire it.
This implies the following semantics:
'hasattr_unacquired(o,a) == True if and only if "getattr(o, a) is obtained by looking at "o" only (and not at its acquisition context)'.
It means also, that "hasattr_unacquired(o, a)" should return "True", when "o" truely has "a" but the current user cannot
access "a". Should the user access such an attribute after the test, he will get an "Unauthorized".
One of my primary usage idioms looks like:
if not hasattr_unacquired(o, id):
# create child "id"
...
child = getattr(o, id)
The primary purpose of the proposed feature is to get a safe way to ask whether given object "o" truely has attribute "a" i.e. does not acquire it.
This implies the following semantics:
'hasattr_ unacquired( o,a) == True if and only if "getattr(o, a) is obtained by looking at "o" only (and not at its acquisition context)'.
It means also, that "hasattr_ unacquired( o, a)" should return "True", when "o" truely has "a" but the current user cannot
access "a". Should the user access such an attribute after the test, he will get an "Unauthorized".
One of my primary usage idioms looks like:
if not hasattr_ unacquired( o, id):
# create child "id"
...
child = getattr(o, id)