Memeplex added the comment:

Martin, there were two reasons:

1. Conciseness: addressof(p.contents) vs. p.value.
2. Uniformity: I expect the value of a pointer to be the address it points to.

Then Eryk pointed out that p.value has already another meaning for simple 
pointer types, so (2) can't be fully achieved and for (1) it will be necessary 
to pick another attribute name. But we could still get something shorter and 
uniform inside the subset of pointer types.

p.as_void makes me expect a c_void_p instance. In that case the address will be 
p.as_void.value (or p.as_void().value?), which is a bit indirect. I think 
p.toaddress conveys the exact meaning[1] and consistently follows the naming 
style of addressof, besides being slightly shorter.


[1] Well, toaddress might mean "get the pointed-to address" or "convert from 
pointer to address", but in any case the meaning is right.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26565>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to