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.
Created on 2012年09月15日 14:41 by facundobatista, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg170518 - (view) | Author: Facundo Batista (facundobatista) * (Python committer) | Date: 2012年09月15日 14:41 | |
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!
|
|||
| msg222973 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2014年07月13日 21:17 | |
@Facundo please accept our apologies for the delay in getting back to you. |
|||
| msg376113 - (view) | Author: Facundo Batista (facundobatista) * (Python committer) | Date: 2020年08月30日 16:36 | |
I'm closing this, it looks to me that behaviour changed and this is safe now. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:36 | admin | set | github: 60151 |
| 2020年08月30日 16:36:20 | facundobatista | set | status: open -> closed messages: + msg376113 stage: resolved |
| 2019年04月26日 19:12:05 | BreamoreBoy | set | nosy:
- BreamoreBoy |
| 2014年07月13日 21:17:33 | BreamoreBoy | set | nosy:
+ amaury.forgeotdarc, BreamoreBoy, meador.inge, belopolsky messages: + msg222973 versions: + Python 3.4, Python 3.5, - Python 3.2 |
| 2012年09月15日 14:41:46 | facundobatista | create | |