This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author facundobatista
Recipients facundobatista
Date 2012-09-15.14:41:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1347720107.38.0.0969129955644.issue15947@psf.upfronthosting.co.za>
In-reply-to
Content
In the doc it says:

"""
Assigning a new value to instances of the pointer types c_char_p, c_wchar_p, and c_void_p changes the memory location they point to, not the contents of the memory block [...].

>>> s = "Hello, World"
>>> c_s = c_wchar_p(s)
>>> print(c_s)
c_wchar_p('Hello, World')
>>> c_s.value = "Hi, there"
>>> print(c_s)
c_wchar_p('Hi, there')
>>> print(s)                 # first object is unchanged
Hello, World
>>>
"""

However, c_s it's not getting "Hi, there" as "the memory location it points to", otherwise next access will surely segfault.

OTOH, if it *does* change the memory location, but the value is cached locally, which is the point of letting it change the memory location? Shouldn't it raise AttributeError or something?

Thanks!
History
Date User Action Args
2012-09-15 14:41:47facundobatistasetrecipients: + facundobatista
2012-09-15 14:41:47facundobatistasetmessageid: <1347720107.38.0.0969129955644.issue15947@psf.upfronthosting.co.za>
2012-09-15 14:41:46facundobatistalinkissue15947 messages
2012-09-15 14:41:45facundobatistacreate