[issue5149] syntactic sugar: type coercion on pointer assignment

2020-10-25 Thread Irit Katriel
Change by Irit Katriel : -- versions: +Python 3.10 -Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5149] syntactic sugar: type coercion on pointer assignment

2011-09-06 Thread Meador Inge
Meador Inge added the comment: Vlad, I agree that having both 'c_char_p' and 'POINTER(c_char)' will just be more work for two seemingly identical constructs. I don't fully understand why both would be needed either (or the implications of removing one of them or making them synonyms). I gue

[issue5149] syntactic sugar: type coercion on pointer assignment

2011-09-06 Thread Vlad Riscutia
Vlad Riscutia added the comment: I believe there is a deeper issue here in ctypes design. Basically we provide both c_char_p and POINTER(c_char) which should behave exactly the same since both are the equivalent of char* in C but internally they have different implementations. c_char_p is co

[issue5149] syntactic sugar: type coercion on pointer assignment

2011-09-02 Thread Meador Inge
Meador Inge added the comment: This is busted for plain old assignment too: Python 3.3.0a0 (default:6374b4ffe00c, Sep 2 2011, 23:50:39) [GCC 4.6.0 20110603 (Red Hat 4.6.0-10)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from ctypes import * >>> buff = c

[issue5149] syntactic sugar: type coercion on pointer assignment

2011-08-07 Thread Vlad Riscutia
Vlad Riscutia added the comment: The main reason for this issue is that internally ctypes doesn't consider c_char_p as a pointer type. This is a bit counter-intuitive, but c_char_p is treated as a simple type and has some other sugar built-in, like easier integration with Python strings. Alte

[issue5149] syntactic sugar: type coercion on pointer assignment

2010-07-31 Thread Mark Lawrence
Changes by Mark Lawrence : -- stage: -> unit test needed type: -> feature request versions: +Python 3.2 -Python 2.6, Python 2.7, Python 3.0, Python 3.1 ___ Python tracker ___ __

[issue5149] syntactic sugar: type coercion on pointer assignment

2009-02-03 Thread Peter A Silva
New submission from Peter A Silva : tough% cat toy.py from ctypes import * class foo(Structure): _fields_ = [ ( "bar", c_char_p ) ] foofoo = foo() babar = create_string_buffer(32) foofoo.bar = babar tough% python toy.py Traceback (most recent call last): File "toy.py", line 11, in