<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.python.cython.user">
    <title>gmane.comp.python.cython.user</title>
    <link>http://blog.gmane.org/gmane.comp.python.cython.user</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9158"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9157"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9156"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9155"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9154"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9153"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9152"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9151"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9150"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9149"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9148"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9147"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9146"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9145"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9144"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9143"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9142"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9141"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9140"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.cython.user/9139"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9158">
    <title>Re: for loop with variable step not optimized</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9158</link>
    <description>&lt;pre&gt;

On Saturday, May 18, 2013 11:43:32 PM UTC-7, Robert Bradshaw wrote:


That makes sense - thanks for the explanation.  And in the case of the 
Pyrex syntax, the stop condition is indicated by using a less than or 
greater than sign.
 

 
You could also check the type of the step variable.  If it's unsigned, step 
is guaranteed to be positive.

&lt;/pre&gt;</description>
    <dc:creator>Josh Ayers</dc:creator>
    <dc:date>2013-05-19T20:14:09</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9157">
    <title>Cythonize is special?</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9157</link>
    <description>&lt;pre&gt;Hello. How exactly is:

from distutils.core import setup
from Cython.Build import cythonize
setup(
    name = "My hello app",
    ext_modules = cythonize('hello.pyx'), # accepts a glob pattern
)

different from:

from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
setup (
ext_modules = [ Extension ( "hello", [ "hello.pyx" ] ) ],
cmdclass    = { "build_ext" : build_ext }
)

Is it just that the former is somewhat shorter, especially seeing as
the docstring for cythonize says: ""Compile a set of source modules
into C/C++ files and return a list of distutils Extension objects for
them.""

Or is there any other essential difference that makes using Cythonize
preferable to manually specifying the Extension params?

Thanks.

&lt;/pre&gt;</description>
    <dc:creator>Shriramana Sharma</dc:creator>
    <dc:date>2013-05-19T11:46:05</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9156">
    <title>Re: Spiro Python interface using Cython</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9156</link>
    <description>&lt;pre&gt;
Hm. 'Twould seem that the code writer *might* be a little more
intelligent to detect when exactly it should forward-declare something
and when not, but this is a minor warning, and you *have* marked it as
a hack, so I guess I need not bother myself about it. (After all, it
isn't something *I* did in my code but the way Cython produces C
code.)

&lt;/pre&gt;</description>
    <dc:creator>Shriramana Sharma</dc:creator>
    <dc:date>2013-05-19T07:44:48</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9155">
    <title>Re: Function pointer as part of a C struct</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9155</link>
    <description>&lt;pre&gt;
Yep.


&lt;/pre&gt;</description>
    <dc:creator>Robert Bradshaw</dc:creator>
    <dc:date>2013-05-19T07:14:30</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9154">
    <title>Re: Spiro Python interface using Cython</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9154</link>
    <description>&lt;pre&gt;I think this is due to
https://github.com/cython/cython/blob/3eea6fff8d3c9272aa49cb7a5d75e82ac74706af/Cython/Compiler/PyrexTypes.py#L2934

On Fri, May 17, 2013 at 11:37 PM, Shriramana Sharma &amp;lt;samjnaa&amp;lt; at &amp;gt;gmail.com&amp;gt; wrote:

&lt;/pre&gt;</description>
    <dc:creator>Robert Bradshaw</dc:creator>
    <dc:date>2013-05-19T07:12:50</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9153">
    <title>Re: Wrapping an abstract class</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9153</link>
    <description>&lt;pre&gt;
You can, see the above example, but you end up with another C++ class
that's not accessible from Python.


If you want it to be visible from Python, yes. Cython is not a
wrapper-generator (though a great too to build one on).

- Robert

&lt;/pre&gt;</description>
    <dc:creator>Robert Bradshaw</dc:creator>
    <dc:date>2013-05-19T06:51:24</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9152">
    <title>Re: First Cython ModuleI</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9152</link>
    <description>&lt;pre&gt;Are you sure you installed Cython? In any case, the reccommended way
to do things is to use cythonize(), see
http://docs.cython.org/src/reference/compilation.html

On Sat, May 18, 2013 at 5:05 AM, Aidin Hasanzadeh
&amp;lt;aidinhasanzadeh&amp;lt; at &amp;gt;gmail.com&amp;gt; wrote:

&lt;/pre&gt;</description>
    <dc:creator>Robert Bradshaw</dc:creator>
    <dc:date>2013-05-19T06:47:16</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9151">
    <title>Win7 Python 2.7 Cython helloworld example compile error ! help ,please</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9151</link>
    <description>&lt;pre&gt;Hi all:

     I am a new user of Cython. I install it by the Anaconda package. When 
i try the example on the website, i get the following problem !

Setup.py 
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

setup(
    cmdclass = {'build_ext': build_ext},
    ext_modules = [Extension("helloworld", ["helloworld.pyx"])]
)

the pyx file is just a print 'hello world' 

the Error :

running build_ext
skipping 'helloworld.c' Cython extension (up-to-date)
building 'helloworld' extension
C:\MinGW\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -IC:\Anaconda\include 
-IC:\Anaconda\PC -c helloworld.c -o 
build\temp.win-amd64-2.7\Release\helloworld.o
writing build\temp.win-amd64-2.7\Release\helloworld.def
creating build\lib.win-amd64-2.7
C:\MinGW\bin\gcc.exe -DMS_WIN64 -shared -s 
build\temp.win-amd64-2.7\Release\helloworld.o 
build\temp.win-amd64-2.7\Release\helloworld.def -LC:\Anaconda\libs 
-LC:\Anaconda\PCbuild\amd64 -lpython27 -lmsvcr90 -o 
build\lib.win-amd64-2.7\helloworld.pyd
build\temp.win-amd64-2.7\Release\helloworld.o:helloworld.c:(.text+0x85): 
undefined reference to `_imp__PyOS_snprintf'
build\temp.win-amd64-2.7\Release\helloworld.o:helloworld.c:(.text+0x8d): 
undefined reference to `_imp__Py_GetVersion'
build\temp.win-amd64-2.7\Release\helloworld.o:helloworld.c:(.text+0x108): 
undefined reference to `_imp__PyOS_snprintf'
build\temp.win-amd64-2.7\Release\helloworld.o:helloworld.c:(.text+0x129): 
undefined reference to `_imp__PyErr_WarnEx'
build\temp.win-amd64-2.7\Release\helloworld.o:helloworld.c:(.text+0x146): 
undefined reference to `_imp__PyTuple_New'
build\temp.win-amd64-2.7\Release\helloworld.o:helloworld.c:(.text+0x170): 
undefined reference to `_imp__PyString_FromStringAndSize'
many undefined reference like the things above  and the final line is as 
following:
collect2: ld ¨Z¨e¨[¨n 1
error: command 'gcc' failed with exit status 1

Can anybody help me ? i know little about the gcc compiler. i supposed the 
problem may be caused by the mingw.

thanks !!

&lt;/pre&gt;</description>
    <dc:creator>杨雪峰</dc:creator>
    <dc:date>2013-05-18T15:54:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9150">
    <title>Cython c compiler setting</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9150</link>
    <description>&lt;pre&gt;Hi all

       I follow the instruction 
from http://wiki.cython.org/64BitCythonExtensionsOnWindows  try to use 
windows c compiler to build python extension. but cython are still using 
mingw gcc to compile my files which cause many undefined reference errors.

      it became green words after i command setenv /x64 /release 

C:\Users\Yang 
Xuefeng\Dropbox\workspaces\pythonxy\autoencoders\Cythonlearning\te 
st&amp;gt;python setup.py build_ext running build_ext skipping 'helloworld.c' 
Cython extension (up-to-date) building 'helloworld' extension 
C:\MinGW\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -IC:\Anaconda\include 
-IC:\Anacon da\PC -c helloworld.c -o 
build\temp.win-amd64-2.7\Release\helloworld.o writing 
build\temp.win-amd64-2.7\Release\helloworld.def C:\MinGW\bin\gcc.exe 
-DMS_WIN64 -shared -s build\temp.win-amd64-2.7\Release\hell oworld.o 
build\temp.win-amd64-2.7\Release\helloworld.def -LC:\Anaconda\libs -LC: 
\Anaconda\PCbuild\amd64 -lpython27 -lmsvcr90 -o 
build\lib.win-amd64-2.7\hellowor ld.pyd 
build\temp.win-amd64-2.7\Release\helloworld.o:helloworld.c:(.text+0x85): 
undefin ed reference to `_imp__PyOS_snprintf'

please , help me !


regards

Yang Xuefeng

&lt;/pre&gt;</description>
    <dc:creator>杨雪峰</dc:creator>
    <dc:date>2013-05-18T18:22:57</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9149">
    <title>First Cython ModuleI</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9149</link>
    <description>&lt;pre&gt;Hey,

I am new with Cython and starting my first module. I am using 
eclipse/Ubunty. I installed cython and tried to implement the very first 
example, Hello world.

http://docs.cython.org/src/userguide/tutorial.html

I made the setup file, but importing Cython.Distutils could not be resolved.

from distutils.core import setupfrom distutils.extension import Extensionfrom Cython.Distutils import build_ext
setup(
    cmdclass = {'build_ext': build_ext},
    ext_modules = [Extension("helloworld", ["helloworld.pyx"])])



Thanks for any help
Aidin

&lt;/pre&gt;</description>
    <dc:creator>Aidin Hasanzadeh</dc:creator>
    <dc:date>2013-05-18T12:05:42</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9148">
    <title>Re: for loop with variable step not optimized</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9148</link>
    <description>&lt;pre&gt;If step is a runtime variable, it doesn't know what the stop condition
should be (which depends on the sign of step). It could of course
still be done by adding a bit more runtime code.

On Sat, May 18, 2013 at 5:01 PM, Josh Ayers &amp;lt;josh.ayers&amp;lt; at &amp;gt;gmail.com&amp;gt; wrote:

&lt;/pre&gt;</description>
    <dc:creator>Robert Bradshaw</dc:creator>
    <dc:date>2013-05-19T06:43:32</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9147">
    <title>Re: Type error</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9147</link>
    <description>&lt;pre&gt;Hi,
          I don't know why, but I decided to run Cython on a dos shell with 
admin privileges.  That resulted in a successful compilation with the 
following result:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32&amp;gt;cd C:\Users\Pedro\Desktop\Paths test

C:\Users\Pedro\Desktop\Paths test&amp;gt;c:\Python27\python setup_Assignment.py 
build_e
xt --inplace
running build_ext
cythoning Assignment2.pyx to Assignment2.c
building 'Assignment' extension
creating build
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo 
/Ox
/MD /W3 /GS- /DNDEBUG -Ic:\Python27\lib\site-packages\numpy\core\include 
-Ic:\Py
thon27\include -Ic:\Python27\PC /TcAssignment2.c 
/Fobuild\temp.win32-2.7\Release
\Assignment2.obj
Assignment2.c
c:\python27\lib\site-packages\numpy\core\include\numpy\npy_deprecated_api.h(8) 
:
 Warning Msg: Using deprecated NumPy API, disable it by #defining 
NPY_NO_DEPRECA
TED_API NPY_1_7_API_VERSION
Assignment2.c(4189) : warning C4018: '&amp;lt;' : signed/unsigned mismatch
Assignment2.c(4843) : warning C4018: '&amp;lt;' : signed/unsigned mismatch
Assignment2.c(4947) : warning C4018: '&amp;lt;' : signed/unsigned mismatch
Assignment2.c(5247) : warning C4018: '&amp;lt;' : signed/unsigned mismatch
Assignment2.c(5804) : warning C4018: '&amp;lt;' : signed/unsigned mismatch
Assignment2.c(5837) : warning C4018: '&amp;lt;' : signed/unsigned mismatch
Assignment2.c(5886) : warning C4018: '&amp;lt;' : signed/unsigned mismatch
Assignment2.c(6277) : warning C4018: '&amp;lt;' : signed/unsigned mismatch
Assignment2.c(6888) : warning C4018: '&amp;lt;' : signed/unsigned mismatch
Assignment2.c(9552) : warning C4018: '&amp;lt;' : signed/unsigned mismatch
Assignment2.c(15223) : warning C4305: '=' : truncation from 'double' to 
'__pyx_t
_10Assignment_DTYPE_t'
c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL 
/nologo
/INCREMENTAL:NO /LIBPATH:c:\Python27\libs /LIBPATH:c:\Python27\PCbuild 
/EXPORT:i
nitAssignment build\temp.win32-2.7\Release\Assignment2.obj 
"/OUT:C:\Users\Pedro\
Desktop\Paths test\Assignment.pyd" 
/IMPLIB:build\temp.win32-2.7\Release\Assignme
nt.lib /MANIFESTFILE:build\temp.win32-2.7\Release\Assignment.pyd.manifest
   Creating library build\temp.win32-2.7\Release\Assignment.lib and object 
build
\temp.win32-2.7\Release\Assignment.exp

C:\Users\Pedro\Desktop\Paths test&amp;gt;

Any ideas?

Thanks,
              Pedro

On Saturday, May 18, 2013 5:33:36 PM UTC-7, Pedro Camargo wrote:

&lt;/pre&gt;</description>
    <dc:creator>Pedro Camargo</dc:creator>
    <dc:date>2013-05-19T06:08:40</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9146">
    <title>Type error</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9146</link>
    <description>&lt;pre&gt;Hi guys,

                  I'm working on a fairly long code that is compiling
correctly, but giving an error when it runs.

 

                I'm working on Windows 64 bits, Python 2.7 (last installer
made available) and the last versions of the installers for
Numpy/Scipy/Cython  made by Chris Gohlke.

 

Thanks for the help,

                

Pedro

 

The error is:

 

File "Assignment2.pyx", line 493, in Assignment._Ordering_and_Forward_Star
(Assignment2.c:6242)

    cdef _Ordering_and_Forward_Star(np.ndarray[ITYPE_t, ndim=2, mode='c']
graph, #A_Node/B_Node

ValueError: Buffer dtype mismatch, expected 'ITYPE_t' but got 'long long'

 

 

 

It points to this header:

 

cdef _Ordering_and_Forward_Star(np.ndarray[ITYPE_t, ndim=2, mode='c'] graph,
#A_Node/B_Node

                    np.ndarray[ITYPE_t, ndim=2, mode='c'] g_aux,

                    np.ndarray[DTYPE_t, ndim=2, mode='c'] graph_data,

                    np.ndarray[DTYPE_t, ndim=2, mode='c'] g_aux2,

                    np.ndarray[ITYPE_t, ndim=1, mode='c'] ind,

                    np.ndarray[ITYPE_t, ndim=1, mode='c'] graph_fs):

 

 

And the matrices are dimensioned and the function called this way:

 

graph=np.zeros((l,2), dtype=ITYPE) #Holds node of origin and node of
destination

graph_fs=np.zeros(nodes+1, dtype=ITYPE)  #Holds the Forward star for the
graph

graph_data=np.zeros((l,2), dtype=DTYPE) #Holds data for the graph. First
column is the nested utility and the second the utility used for Shortest
path

.

g_aux=graph.copy() #to sort the indices

g_aux2=graph_data.copy()

 

_Ordering_and_Forward_Star(graph,

                               g_aux,

                               graph_data,

                               g_aux2,

                                ind,

                                graph_fs)

 

Searching the problem I saw references to a problem of 32 Vs. 64 bits, but
when I tried with 32 bits I get this:

 

C:\Users\Pedro\Desktop\Paths test&amp;gt;c:\Python27\python setup_Assignment.py
build_e

xt --inplace

running build_ext

skipping 'Assignment2.c' Cython extension (up-to-date)

building 'Assignment' extension

Traceback (most recent call last):

  File "setup_Assignment.py", line 23, in &amp;lt;module&amp;gt;

    include_dirs=[np.get_include()])

  File "c:\Python27\lib\distutils\core.py", line 152, in setup

    dist.run_commands()

  File "c:\Python27\lib\distutils\dist.py", line 953, in run_commands

    self.run_command(cmd)

  File "c:\Python27\lib\distutils\dist.py", line 972, in run_command

    cmd_obj.run()

  File "c:\Python27\lib\site-packages\Cython\Distutils\build_ext.py", line
163,

in run

    _build_ext.build_ext.run(self)

  File "c:\Python27\lib\distutils\command\build_ext.py", line 339, in run

    self.build_extensions()

  File "c:\Python27\lib\site-packages\Cython\Distutils\build_ext.py", line
171,

in build_extensions

    self.build_extension(ext)

  File "c:\Python27\lib\distutils\command\build_ext.py", line 498, in
build_exte

nsion

    depends=ext.depends)

  File "c:\Python27\lib\distutils\msvc9compiler.py", line 473, in compile

    self.initialize()

  File "c:\Python27\lib\distutils\msvc9compiler.py", line 383, in initialize

    vc_env = query_vcvarsall(VERSION, plat_spec)

  File "c:\Python27\lib\distutils\msvc9compiler.py", line 299, in
query_vcvarsal

l

    raise ValueError(str(list(result.keys())))

ValueError: [u'path']

 

C:\Users\Pedro\Desktop\Paths test&amp;gt;

&lt;/pre&gt;</description>
    <dc:creator>Pedro Camargo</dc:creator>
    <dc:date>2013-05-19T00:33:36</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9145">
    <title>for loop with variable step not optimized</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9145</link>
    <description>&lt;pre&gt;I just noticed that a for-loop using the standard Python range construct 
isn't optimized to C-code if the step is a run-time variable.  It is 
optimized if the step parameter is a compile-time constant, or if the old 
Pyrex style for-loop syntax is used.  I tested with Cython 0.18 and 0.19.1 
and both behaved the same way.

Here's a minimal example.

DEF STEP = 2

def loops():
    cdef int i, start = 0, stop = 10, step = 2

    for i in range(start, stop, step): # generates Python loop
        print(i)

    for i in range(start, stop, STEP): # generates C loop
        print(i)

    for i from start &amp;lt;= i &amp;lt; stop by step: # generates C loop
        print(i)

Is this a bug?

Thanks,
Josh Ayers

&lt;/pre&gt;</description>
    <dc:creator>Josh Ayers</dc:creator>
    <dc:date>2013-05-19T00:01:09</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9144">
    <title>Re: Re: TypeError: can't apply this __setattr__</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9144</link>
    <description>&lt;pre&gt;
On Wed, May 15, 2013 at 10:59 AM, Stefan Behnel &amp;lt;stefan_ml&amp;lt; at &amp;gt;behnel.de&amp;gt;  
wrote:

On Sat, 18 May 2013 22:31:50 +0600, Pauli Virtanen &amp;lt;pav&amp;lt; at &amp;gt;iki.fi&amp;gt; wrote:

In CPython, True and False are statically allocated singletons.
As a result, Python bool objects (when properly typed in Cython)
are _almost_ as efficient as bint.

bint is preferred because:
1) bool objects have to be refcounted, which means every bool assignment
    has an extra INCREF/DECREF.
    (Cython also inserts an unnecessary typecheck when constants are  
assigned).
2) On x64, bool takes 8 bytes (like PyObject *), while bint is 4 (like  
int).
3) bool check is 2 pointer comparisons + (unlikely) PyObject_IsTrue call.
    This requires a few more instructions compared to one zero check in case
    of bint.


Best regards,
Nikita Nemkin

&lt;/pre&gt;</description>
    <dc:creator>Nikita Nemkin</dc:creator>
    <dc:date>2013-05-18T17:02:50</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9143">
    <title>Re: TypeError: can't apply this __setattr__</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9143</link>
    <description>&lt;pre&gt;18.05.2013 19:23, Shriramana Sharma kirjoitti:

(i) class information, (ii) garbage collection information. I'd imagine
the situation is the same in Java and any other language with boxed values.

&lt;/pre&gt;</description>
    <dc:creator>Pauli Virtanen</dc:creator>
    <dc:date>2013-05-18T16:31:50</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9142">
    <title>Re: Re: TypeError: can't apply this __setattr__</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9142</link>
    <description>&lt;pre&gt;
Wow, but *why* is the question?!

&lt;/pre&gt;</description>
    <dc:creator>Shriramana Sharma</dc:creator>
    <dc:date>2013-05-18T16:23:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9141">
    <title>Re: Re: TypeError: can't apply this __setattr__</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9141</link>
    <description>&lt;pre&gt;
In [1]: import struct

In [2]: struct.calcsize("?")
Out[2]: 1

In [3]: struct.calcsize("i")
Out[3]: 4

In [4]: True.__sizeof__()
Out[4]: 24



--
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169

&lt;/pre&gt;</description>
    <dc:creator>Lisandro Dalcin</dc:creator>
    <dc:date>2013-05-18T16:14:23</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9140">
    <title>Re: pointer to memory view</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9140</link>
    <description>&lt;pre&gt;Den 18. mai 2013 kl. 08:51 skrev Josh Ayers &amp;lt;josh.ayers&amp;lt; at &amp;gt;gmail.com&amp;gt;:


Yes, that is the way to do it.

Just forget about np.ndarray[whatever], it is not a memory view. :)


Sturla



&lt;/pre&gt;</description>
    <dc:creator>Sturla Molden</dc:creator>
    <dc:date>2013-05-18T12:26:22</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9139">
    <title>Re: pointer to memory view</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9139</link>
    <description>&lt;pre&gt;
The np.NPY_FLOAT64 and similar constants are just integer codes that are 
meant to be passed to the various NumPy array creation functions.  The 
actual types are np.float64_t, float32_t, etc. 

If you just want a memoryview to use within Cython, this should work 
without copying the data.  I'm assuming X_ptr is the 2D C array, with the 
elements stored row-first, and its size is nrows by ncols.

from numpy cimport float64_t
cdef Py_ssize_t nrows = xxx, ncols = xxx
cdef float64_t [:, ::1] X = &amp;lt;float64_t [:nrows, :ncols]&amp;gt; X_ptr

Note that the memoryview won't free the memory of the underlying C array.  
You'll have to do that yourself once you're done with it.

Hope that helps.
 

&lt;/pre&gt;</description>
    <dc:creator>Josh Ayers</dc:creator>
    <dc:date>2013-05-18T06:51:39</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.cython.user/9138">
    <title>Spiro Python interface using Cython</title>
    <link>http://permalink.gmane.org/gmane.comp.python.cython.user/9138</link>
    <description>&lt;pre&gt;Spiro is an algorithm for producing smooth splines given a set of
on-curve control points. I am working on polishing the library. I
wrote a Python interface using Cython (thanks to all those who develop
it!).

The Spiro library uses callbacks, hence my recent in doing that in
Cython. I am happy to say I have been successful. The attached code
demonstrates it to whoever can spend the time to read it. The code is
under the GPLv3+. (Note: you don't need to worry about the internals
of spiro.c -- just look at spiro.h and bezctx.h to understand the
library being wrapped.)

I have one question: Clang generates the warning:

spiro_cy.c:653:1: warning: declaration does not declare anything
[-Wmissing-declarations]
spiro_cp;
^~~~~~~~
1 warning generated.

Why is this and what should I do to fix it? Thanks.

&lt;/pre&gt;</description>
    <dc:creator>Shriramana Sharma</dc:creator>
    <dc:date>2013-05-18T06:37:40</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.python.cython.user">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.python.cython.user</link>
  </textinput>
</rdf:RDF>
