>
> For your system, you may need a way of annotating function
> declarations with refcounting rules where they differ from
> the defaults.
Yeah, and i have to encode that to some extent in the type system.
However I have two techs to play with: Felix and C++. Both can,
for example, do subtyping
On 29/01/20 8:37 am, John Skaller2 wrote:
If I implement that with just static casts for coercions, then say,
given a dictionary and a function accepting a mapping argument,
you can pass a dictionary or mapping, but not an object.
If you want to pass an object you have to explicitly coerce it.
On 29/01/20 1:33 am, John Skaller2 wrote:
# This conflicts with the C++ bool type, and unfortunately
# C++ is too liberal about PyObject* <-> bool conversions,
# resulting in unintuitive runtime behavior and segfaults.
#("bool","PyBool_Type", []),
Now you have me worried! Any more
So I just had a thought, I might try something to enhance the bindings.
Not sure if it will work.
My system supports subtyping. For bindings and other nominal types
you can simple define a subtyping coercion.
Now in Python we have subtyping rules like:
dictionary -> mapping -> object
If I impl
> On 28 Jan 2020, at 21:07, Stefan Behnel wrote:
>
> John Skaller2 schrieb am 28.01.20 um 10:57:
>> What’s a “descr” when its at home?
>
> A descriptor, a special protocol in Python.
>
> https://docs.python.org/3/howto/descriptor.html
Got it, thanks!
>
>> There are some special words in px
John Skaller2 schrieb am 28.01.20 um 10:57:
> What’s a “descr” when its at home?
A descriptor, a special protocol in Python.
https://docs.python.org/3/howto/descriptor.html
> There are some special words in pxd files like “list” which mean
> PyObject that happens to be a list. Is there a list o
What’s a “descr” when its at home?
There are some special words in pxd files like “list” which mean
PyObject that happens to be a list. Is there a list of these somewhere?
—
John Skaller
skal...@internode.on.net
___
cython-devel mailing list
cython
Ok, quick pass on Cython reference .. pretty good.
Easy to read, good coverage, well written.
Beginning to understand the design.
Interesting thing is the limitations are the best clue. For example:
"The “?” indicates that the value -1 only indicates a possible error.
In this case, Cython gene
> On 27 Jan 2020, at 20:23, Greg Ewing wrote:
>
> On 27/01/20 6:56 pm, John Skaller2 wrote:
>> Felix binds C/C++ code with statements like:
>> type PyObject = “PyObject*”;
>> fun add: PyObject * PyObject -> PyObject = “Py_AddLong($1)”;
>> and can use the bindings like:
>>
>>
John Skaller2 schrieb am 27.01.20 um 06:56:
> Hi! I have just built Cython but haven’t used it yet.
>
> I want to check I understand what it does whilst examing the sources in the
> repository.
> Please let me know if I have it wrong!
>
> Given a Python file, Cython parses it, and translates it
On 27/01/20 6:56 pm, John Skaller2 wrote:
Felix binds C/C++ code with statements like:
type PyObject = “PyObject*”;
fun add: PyObject * PyObject -> PyObject = “Py_AddLong($1)”;
and can use the bindings like:
var a : PyObject = ….
var b: PyObject = ...
Hi! I have just built Cython but haven’t used it yet.
I want to check I understand what it does whilst examing the sources in the
repository.
Please let me know if I have it wrong!
Given a Python file, Cython parses it, and translates it to the equivalent C,
which can
then be compiled to binary
12 matches
Mail list logo