after embedding and extending python (using swig) problem importing (non-core) modules

2004-12-07 Thread stefan
l's? (it even does not work if i have the pyd files in the (same) folder than the system where I start my embedded python program. It would be great if someone would have an idea, at least how to get me started on this. thanks a lot in advance, -stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: after embedding and extending python (using swig) problem importing (non-core) modules

2004-12-08 Thread stefan
thanks a lot for the quick answer. I had to provide the debug-versions, since I was in debug mode, like you already expected! thanks a lot again! -stefan -- http://mail.python.org/mailman/listinfo/python-list

Howto get the argument defaults of a function using an AST-object?

2006-07-04 Thread stefan
()) I can only get a list with the arguments or the defaults. The following examples would return the same: def foo(x, y=True) def foo(x=True, y) Anyone an idea? Thanks, Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Howto get the argument defaults of a function using an AST-object?

2006-07-04 Thread stefan
es for syntax errors. Thanks a lot, Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with implementing callback functions using ctypes

2013-05-09 Thread Stefan Behnel
the GIL when you don't need it, and the compiler will produce errors when you try to do things that require the GIL while you don't own it. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python C-API: how to define nested classes?

2013-05-16 Thread Stefan Behnel
in this case. If you need better compatibility, consider writing your code in Cython. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Short-circuit Logic

2013-05-31 Thread Stefan Drees
os on this thread, maybe a package on pypi first grounding somewhat the presumably massive discussion thread on python-ideas :-?) All the best, Stefan. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to check for threads being finished?

2013-07-06 Thread Stefan Behnel
s iterating over results as they come in. It also comes with a parallel map() implementation. http://docs.python.org/3/library/concurrent.futures.html#threadpoolexecutor-example http://docs.python.org/3/library/concurrent.futures.html#module-functions New in Py3.2, but there's also a backport AFAIR. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Explain your acronyms (RSI?)

2013-07-06 Thread Stefan Behnel
log out of your Google accounts, and then retry. Maybe disabling JavaScript helps. Or enabling the Privacy Mode in your browser. Or try a different browser all together. Or a different search engine. Google has lots of ways to detect who's asking. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Babel i18n package has new maintainers

2013-07-09 Thread Stefan Behnel
x27;m sure Armin and Alex can use some help and testing by others to get a new release out. There's always stuff like reading through and updating the documentation, finding bugs, testing with your existing code base, etc., that everyone can help with. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Best Scripting Language for Embedded Work?

2013-07-10 Thread Stefan Behnel
statement. ISTM that most projects that use Lua build their own eco-system around it, or integrate Lua into their existing eco-system, with the obvious drawbacks for code reuse across different projects and user bases. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Mypy

2013-07-11 Thread Stefan Behnel
Fábio Santos, 11.07.2013 10:16: > Guido tweeted that yesterday. It seems interesting. Although I'm not > comfortable using a subset of the language. > > They seem to want to kill the GIL. This could get much more popular when > they do. Then don't forget to also take

Re: Best Scripting Language for Embedded Work?

2013-07-11 Thread Stefan Behnel
t; > I tend to agree with you. I'm not sure how go monolithic with Python. PyRun? py2exe? Just to name two. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Play Ogg Files

2013-07-19 Thread Stefan Behnel
Well, since you mentioned it already, have you actually looked at pygame? It should be able to do what you want. There's also pyaudio, which is more specialised to, well, audio. A web search for python and ogg might provide more. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I make this piece of code even faster?

2013-07-21 Thread Stefan Behnel
an unbalanced way that it visibly changes its execution profile. Always make sure you validate your code changes with benchmarks, outside of the profiler. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Play Ogg Files

2013-07-21 Thread Stefan Behnel
Devyn Collier Johnson, 20.07.2013 14:25: > On 07/20/2013 12:21 AM, Stefan Behnel wrote: >> Devyn Collier Johnson, 20.07.2013 03:06: >>> I am making a chatbot that I host on Launchpad.net/neobot. I am currently >>> converting the engine from BASH code to Python3.

Re: Python 3: dict & dict.keys()

2013-07-24 Thread Stefan Behnel
d for the simple case, you'd have to type more, either the additional .keys() or the useless tuple unpacking. So, the reasoning is that iteration should do the basic thing that still allows you to do everything, instead of doing everything and pushing unnecessary work on the users by default. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3: dict & dict.keys()

2013-07-24 Thread Stefan Behnel
problem. They reduce the API overhead. Previously, you needed values() and itervalues(), with values() being not more than a special case of what itervalues() provides anyway. Now it's just one method that gives you everything. It simply has corrected the tradeoff from two special purpose API

Re: Dihedral

2013-07-24 Thread Stefan Behnel
hinking that maybe it is a human being. It had me fooled for a long >>> time. > > Does this mean he passes the Turing test? I'd say that "it" appears more correct. Or is there any indication of a specific bot gender? (I sure might have missed it...) Note that

Re: Python 3: dict & dict.keys()

2013-07-24 Thread Stefan Behnel
Ethan Furman, 24.07.2013 20:31: > On 07/24/2013 10:23 AM, Stefan Behnel wrote: >> Peter Otten, 24.07.2013 08:23: >>> Ethan Furman wrote: >>>> >>>> So, my question boils down to: in Python 3 how is dict.keys() different >>>> from dict? What ar

Re: embedded python and threading

2013-07-26 Thread Stefan Behnel
9: File "", line 55, in main > 9: AttributeError: 'builtin_function_or_method' object has no attribute > 'sleep' > > suddenly the sleep module has been unloaded?? huh? i thought the thread > state had been preserved? You didn't sh

Re: embedded python and threading

2013-07-26 Thread Stefan Behnel
e same globals dict for both scripts, I guess? That explains it then. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: collections.Counter surprisingly slow

2013-07-29 Thread Stefan Behnel
doesn't have this accelerator function. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: collections.Counter surprisingly slow

2013-07-29 Thread Stefan Behnel
slower for mostly unique data. Maybe a "fast_dict_lookup" option for the accelerator that forces the fast path would fix this. The Counter class, just like many (most?) other subtypes of dict, definitely doesn't need the fallback behaviour. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: collections.Counter surprisingly slow

2013-07-29 Thread Stefan Behnel
Stefan Behnel, 30.07.2013 08:39: > Serhiy Storchaka, 29.07.2013 21:37: >> 29.07.13 20:19, Ian Kelly написав(ла): >>> On Mon, Jul 29, 2013 at 5:49 AM, Joshua Landau wrote: >>>> Also, couldn't Counter just extend from defaultdict? >>> >>> It cou

Re: Checking compatibility of a script across Python versions automatically

2012-06-18 Thread Stefan Behnel
My advice: write a good test suite for your code and use something like tox to run it under the various Python versions that you want to support. No static analysis tool will ever be able to find all portability problems. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is python a interpreted or compiled language?

2012-06-20 Thread Stefan Behnel
us degrees of interpretation and compilation, such as JIT compilation of otherwise interpreted code. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't understand python C apis

2012-06-23 Thread Stefan Behnel
or python C api. > > What should i do? Which file's code should i read to understand those > PyObject or other type and other C apis? The first thing to ask yourself is: why do you want to understand it? What is the thing you are trying to do with it? Once you've answered that, i

Re: How can i call array_length to get the length of array object?

2012-06-24 Thread Stefan Behnel
for everything than to look up and sometimes even learn one method for each kind of object you are dealing with? Python prefers simplicity here. You want the length? Use len(). Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are these files names started with underscore?

2012-06-24 Thread Stefan Behnel
r something? Yes. Please read the CPython developer guide (click on "core development" on the Python front page). Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is python source code not available on github?

2012-06-24 Thread Stefan Behnel
from the source repository. However, if you want to contribute to the project, it's still worth considering to work with Mercurial. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is python source code not available on github?

2012-06-24 Thread Stefan Krah
ve-vuln-in-ruby/ Stefan Krah -- http://mail.python.org/mailman/listinfo/python-list

Re: Faster way to map numpy arrays

2012-06-25 Thread Stefan Behnel
he performance. http://docs.cython.org/src/tutorial/numpy.html Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-25 Thread Stefan Behnel
t. And, no, there won't be a Py4 in 5 years. The established release time frame is way longer. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-25 Thread Stefan Behnel
ocal screen but also directly to the PSF so that they can fund developers who are able to delete that error message from the interpreter based on real world statistical evidence. That would eventually make the language match the powerset of what all users have in their fingers. A very worthy goal, if you ask me. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-25 Thread Stefan Behnel
you can even pass it into some code as callback, although I rarely had a need for that. Stefan [1] Seriously, it's not very helpful in interactive mode and too simplistic to be used in application code. Even scripts often work better with logging than with prints. -- http://mail.python.org/mailman/listinfo/python-list

Re: Frustrating circular bytes issue

2012-06-26 Thread Stefan Behnel
chunks, I > removed that to test a theory. It creates buffer_new with the output > of the read. > > Running type() on buffer_new tells me that it's a bytes object. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Stefan Behnel
ing in Py2.[67] (which supports the opposite "b" prefix). We've been supporting that in Cython for a while and it worked out really well so far. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Stefan Behnel
;imperfect" way, either by doing the right thing already or by printing out a tuple instead of a space separated string. If it's only for debug output (which, as I said, would better be served by the logging module), I can't see why that would be all that unacceptable. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-27 Thread Stefan Behnel
and start warning about it in the next one. You're then free to use the corresponding 2to3 fixer to get it back out of your code with a single patch. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: when "normal" parallel computations in CPython will be implemented at last?

2012-07-02 Thread Stefan Behnel
ce cleared and all that, but nevertheless non-MS. When they dropped the IronPython project, it became free to integrate with other software. Clearly a cultural thing. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Best data structure for DFS on large graphs

2012-07-03 Thread Stefan Behnel
> help much right? Dicts are fast for lookup, not for searching. > Anyway, does python have a built-in BST like data-structure ? It has lists and bisect: http://docs.python.org/library/bisect.html Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: 2 + 2 = 5

2012-07-04 Thread Stefan Behnel
e > five.contents[five.contents[:].index(5)] = 4 > print(2 + 2 == 5) # True (must be sufficiently large values of 2 there...) > > Heh. The author is apparently anonymous, I guess for good reason. That's not portable, though. ;) Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Interview Questions

2012-07-10 Thread Stefan Behnel
shoes for each job interview sounds reasonable once you have a salary well beyond your own capabilities. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing a wrapper - any tips?

2012-07-13 Thread Stefan Behnel
rop the lowest layer entirely. In fact, my advice is to really skip that lowest layer in a Cython wrapper, because if it's really just a 1:1 mapping, it's going to end up with a lot of boring and redundant code and you won't gain anything from it. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Implicit conversion to boolean in if and while statements

2012-07-15 Thread Stefan Behnel
ting to True by default (object), unless they implement the test themselves. As Chris said, very convenient. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: jython lacks working xml processing modules?

2012-07-17 Thread Stefan Behnel
gaodexiaozh...@gmail.com, 17.07.2012 10:35: > hi,do you know the PyXML whether can be supported by Jython ? PyXML is a dead project, don't use it. You can use ElementTree in Jython, just as in Python. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: jython lacks working xml processing modules?

2012-07-17 Thread Stefan Behnel
Matej Cepl, 17.07.2012 11:39: > On 17/07/12 10:35, gaodexiaozh...@gmail.com wrote: >>> > I'm trying to parse an xml file with jython (not through java >>> parsers >>> > like xerces). > > https://code.google.com/p/jython-elementtree/ ??? Note tha

Re: dict: keys() and values() order guaranteed to be same?

2012-07-23 Thread Stefan Behnel
rily -- then I'd > obviously avoid relying on it. You should. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: dict: keys() and values() order guaranteed to be same?

2012-07-23 Thread Stefan Behnel
that it's a common property. Iteration over data structures should tend to be deterministic, after all. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: catch UnicodeDecodeError

2012-07-26 Thread Stefan Behnel
. But then, suddenly, there is a bad > character in a new file. (This is so because most files today are > generated by people who don't know that there is such a thing as > encodings.) And then I need to rewrite my very complex program just > because of one single character in one single file. Why would that be the case? The places to change should be very local in your code. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: catch UnicodeDecodeError

2012-07-26 Thread Stefan Behnel
open and parse different > types of files. When I read and parse a directory with such different > types of files, a program that > uses > > for line in f: > > will not exit with any hint as to where the error occurred. I just > exits with a UnicodeDecodeError. ... that tells you the exact code line where the error occurred. No need to look around. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: catch UnicodeDecodeError

2012-07-26 Thread Stefan Behnel
Philipp Hagemeister, 26.07.2012 14:17: > On 07/26/2012 01:15 PM, Stefan Behnel wrote: >>> exits with a UnicodeDecodeError. >> ... that tells you the exact code line where the error occurred. > > Which property of a UnicodeDecodeError does include that information? >

counting source lines (was: Is Python a commercial proposition ?)

2012-07-29 Thread Stefan Behnel
> fact it was remarkably easy to do this in python Just a comment on this part. An even easier way to count source lines is by using the tool "SLOCCount". It also works with various languages. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python a commercial proposition ?

2012-07-29 Thread Stefan Behnel
mentation). I find it perfectly reasonable to use C code (and other kinds of low-level code) in Python tools and applications. In fact, easy interfacing with low-level code is one of (C)Python's major selling points. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python a commercial proposition ?

2012-07-29 Thread Stefan Behnel
r backends, usually written in languages I don't have to care about because they provide a language independent interface. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: py2c - an open source Python to C/C++ is looking for developers

2012-07-30 Thread Stefan Behnel
s to > leverage off of PyPy's toolchain, for example? >From a look at the source code, it seems hard to bring it together with anything. It looks very monolithic. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python a commercial proposition ?

2012-07-30 Thread Stefan Behnel
Paul Rubin, 31.07.2012 06:45: > A real compiler (PyPy) will help Python performance far more than > multi-core currently can. That's too general a statement to be meaningful. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: profiling and optimizing

2012-07-31 Thread Stefan Behnel
eck if the deep copy is really necessary, and if so, if it is really necessary to do it over the full depth of the entire object graph. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: py2c - an open source Python to C/C++ is looking for developers

2012-07-31 Thread Stefan Behnel
Stefan Behnel, 31.07.2012 07:23: > From a look at the source code, it seems hard to bring it together with > anything. It looks very monolithic. Hmm, sorry, I mixed it up with "2c.py", which is yet another of those Python-to-C compilers with an all too similar name. https://code

Re: docx/lxml

2012-07-31 Thread Stefan Behnel
NoneType' object has no > attribute 'clone' > > Well, I think I'm starting to feel less and less enthusiastic about python... > I didn't suspect it would be so difficult to write a basic doc file :) "pip" goes with "distribute", not "setuptools". http://packages.python.org/distribute/ Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python a commercial proposition ?

2012-08-01 Thread Stefan Behnel
#x27;re ready to >>> drink it from the glass. Don't you know anything about the importance of >>> process and timing? :) >> >> Heh heh, obviously never got drunk ... er I mean served behind the bar >> at uni/college/pub %-} > > Nah, obviously *is*

Re: C extension module doesn't throw exception after setting error indicator through PyErr_SetString()

2012-08-02 Thread Stefan Behnel
rahul, 02.08.2012 11:50: > When I use same code base for Python 3.x, then behavior is different. You might want to take a look at Cython. It moves most of these "funny" little details off your shoulders. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python a commercial proposition ?

2012-08-03 Thread Stefan Behnel
s/disclosures/email. Huh? Who's still trying to sell viruses these days? I thought they came for free? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: On-topic: alternate Python implementations

2012-08-03 Thread Stefan Behnel
iler that is widely used. Compiles and optimises Python to C code that uses the CPython runtime and allows for easy manual optimisations to get C-like performance out of it. http://cython.org/ Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Steven D'Aprano, 04.08.2012 09:49: > On Sat, 04 Aug 2012 08:40:16 +0200, Stefan Behnel wrote: >> And not to forget Cython, which is the only static Python compiler that >> is widely used. Compiles and optimises Python to C code that uses the >> CPython runtime

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Mark Lawrence, 04.08.2012 12:05: > I agree so it's off topic and can't be discussed here. Isn't that right, > Stefan? Hmm, in case you are referring to a recent friendly and diplomatic request of mine regarding a couple of people who were burdening a public high volume maili

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Krah
zero-fault software world: Several verification tools do exist and Leroy et al. are writing a certified compiler for C to plug the hole between the verified source code and the generated assembly. Stefan Krah -- http://mail.python.org/mailman/listinfo/python-list

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
ation is written in C and makes it easy to interface with C code. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Thomas Rachel, 04.08.2012 14:51: > Am 04.08.2012 11:10 schrieb Stefan Behnel: >> As long as you don't use any features of the Cython language, it's plain >> Python. That makes it a Python compiler in my eyes. > > Tell that the C++ guys. C++ is mainly a superset of

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Stefan Behnel, 04.08.2012 15:53: > Thomas Rachel, 04.08.2012 14:51: >> Am 04.08.2012 11:10 schrieb Stefan Behnel: >>> As long as you don't use any features of the Cython language, it's plain >>> Python. That makes it a Python compiler in my eyes. >>

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Paul Rubin, 04.08.2012 17:59: > Stefan Krah writes: >> In the free software world, apparently many people like C. C is also >> quite popular in the zero-fault software world: Several verification >> tools do exist and Leroy et al. are writing a certified compiler for >>

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Paul Rubin, 04.08.2012 20:18: > Stefan Behnel writes: >>> C is pretty poor as a compiler target: how would you translate Python >>> generators into C, for example? >> Depends. If you have CPython available, that'd be a straight forward >> extension type.

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Paul Rubin, 04.08.2012 22:43: > Stefan Behnel writes: >>> Calling CPython hardly counts as compiling Python into C. >> CPython is written in C, though. So anything that CPython does can be >> done in C. It's not like the CPython project used a completely unu

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
ge) can be called directly from other code implemented in C. That's very common in the CPython ecosystem. There are a lot of simple things that quickly add up into a much better performance on average. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: On-topic: alternate Python implementations

2012-08-04 Thread Stefan Behnel
Jürgen A. Erhard, 05.08.2012 01:25: > On Sat, Aug 04, 2012 at 08:40:16AM +0200, Stefan Behnel wrote: >> Steven D'Aprano, 04.08.2012 08:15: >>> Most people are aware, if only vaguely, of the big Four Python >>> implementations: >> >> And not to fo

Re: On-topic: alternate Python implementations

2012-08-05 Thread Stefan Behnel
Stefan Behnel, 05.08.2012 07:46: > Jürgen A. Erhard, 05.08.2012 01:25: >> None of the other implementations require Python for actually >> compiling or running Python source. > > Nuitka was on the list as well. Oh, and Stackless was also on Steven's list, as well as W

Re: On-topic: alternate Python implementations

2012-08-05 Thread Stefan Behnel
There's also HotPy: > > http://code.google.com/p/hotpy/ > http://www.hotpy.org/ And just in case anyone was wondering where the others are: http://wiki.python.org/moin/PythonImplementations Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: On-topic: alternate Python implementations

2012-08-05 Thread Stefan Behnel
Jürgen A. Erhard, 05.08.2012 14:28: > On Sun, Aug 05, 2012 at 07:46:59AM +0200, Stefan Behnel wrote: >> Jürgen A. Erhard, 05.08.2012 01:25: >>> None of the other implementations require Python for actually >>> compiling or running Python source. >> >> Nu

Re: Alternate Python extensions (was alternate Python implementations)

2012-08-06 Thread Stefan Behnel
t maintained somewhere? Hijacking this page would be a good place to start it IMHO: http://wiki.python.org/moin/Embedding%20and%20Extending Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: [c-api]Transmutation of an extension object into a read-only buffer adding an integer in-place.

2012-08-10 Thread Stefan Behnel
e a look at Cython. It makes these things way easier and safer than with manually written C code. It will save you a lot of code, debugging and general hassle. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: [c-api]Transmutation of an extension object into a read-only buffer adding an integer in-place.

2012-08-10 Thread Stefan Behnel
on't have to read them. :) Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: [c-api]Transmutation of an extension object into a read-only buffer adding an integer in-place.

2012-08-11 Thread Stefan Behnel
Giacomo Alzetta, 11.08.2012 10:55: > Il giorno sabato 11 agosto 2012 08:40:18 UTC+2, Stefan Behnel ha scritto: >> Giacomo Alzetta, 11.08.2012 08:21: >> >>> I'd prefer to stick to Python and C, without having to put cython >>> sources or cython-genera

Re: Help needed installing easy_install and lxml2

2012-08-16 Thread Stefan Behnel
led ** > > Using build configuration of libxslt > error: Setup script exited with error: Unable to find vcvarsall.bat > > C:\Users\ian> > > Now what? I thought I was installing the binary package do I would not need > any development versions. > > What do these

Re: type(None)()

2012-08-16 Thread Stefan Behnel
e time machine strikes again. Python 3.3.0b1 (default:f7b59e890e30, Aug 11 2012, 05:30:10) [GCC 4.6.3] on linux Type "help", "copyright", "credits" or "license" for more information. >>> type(None)() >>> print(type(None)()) None Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: type(None)()

2012-08-16 Thread Stefan Behnel
Ramchandra Apte, 16.08.2012 17:39: > On 16 August 2012 21:01, Stefan Behnel wrote: >> Steven D'Aprano, 16.08.2012 15:58: >>>>> NoneType raises an error if you try to create a second instance. >>> In my opinion, this is a PITA for None and better behaviour w

Re: python+libxml2+scrapy AttributeError: 'module' object has no attribute 'HTML_PARSE_RECOVER'

2012-08-18 Thread Stefan Behnel
o old and doesn't support parsing real-world HTML. IIRC, that started with 2.6.21 and got improved a bit after that. Get a 2.8.0 installation, as someone pointed out already. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: XML parser: Element ordering?

2012-08-31 Thread Stefan Behnel
must ignore the order in which elements occur. But that won't magically make the parser ignore it for you. That's a totally different level of abstraction and a deliberate decision of the code that *uses* the parser. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Cython 0.17 released

2012-09-01 Thread Stefan Behnel
ostly usable in Cython 0.17. All of this makes Cython the ideal language for wrapping external C libraries, embedding CPython into existing applications, and for fast C modules that speed up the execution of Python code. Have fun, Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: py2c - an open source Python to C/C++ is looking for developers

2012-09-01 Thread Stefan Behnel
ou think you can do better here then IronPython or PyPy, please go ahead. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: running Lua in Python

2012-09-02 Thread Stefan Behnel
sed to run on (macs with OS X Lion) and it seems to > be dormant. > > My requirements are stock OS X Python (which is 2.7) and Lua 5.2. I'm > looking for either a way to make lunatic-python work or another tool > that would do the job. Try Lupa: http://pypi.python.org/pypi/lu

Re: running Lua in Python

2012-09-02 Thread Stefan Behnel
mportantly it seems to require a > custom build of Python, which I don't want. I have no idea why you say that, for neither of the two. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: running Lua in Python

2012-09-02 Thread Stefan Behnel
Arnaud Delobelle, 02.09.2012 21:17: > On 2 September 2012 19:42, Stefan Behnel wrote: >> Arnaud Delobelle, 02.09.2012 20:34: >>> On 2 September 2012 10:49, Arnaud Delobelle wrote: >>>> On 2 September 2012 10:39, Alec Taylor wrote: >>>>> http://pypi.p

RPython, static type annotations, SafePython project (was: PhD Python & Smalltalk grant possibility (Lille/INRIA))

2012-09-05 Thread Stefan Behnel
; Lille is located in the north of france at the border to Belgium > one hour from Paris, 1h20 from London, 35 min from Brussels, by train. And the most important thing (which you forgot to mention): a nice place to live. > French food, combined with belgian beer. Well, yes, but it's still a nice place to live. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Fastest web framework

2012-09-23 Thread Stefan Behnel
t makes the comparison (which may or may not be biased towards his own engine) a bit less interesting. Worth keeping this in mind: http://www.codeirony.com/?p=9 Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Fastest web framework

2012-09-23 Thread Stefan Behnel
atabase you get your list and can easily > cache it. The next call IS without impact that database call may > cause... but you still keep serving pages out... Well, if it was really that easy, you wouldn't be using a database in the first place but static pages, would you? Stefan

Re: How to pass FILE *

2012-09-29 Thread Stefan Behnel
stackoverflow, you may also consider switching from ctypes to Cython. It makes these things a bit more straight forward. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: [RELEASED] Python 3.3.0

2012-09-29 Thread Stefan Behnel
mplementation almost a month ago! ;) Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: [RELEASED] Python 3.3.0

2012-09-29 Thread Stefan Behnel
Christian Heimes, 29.09.2012 16:06: > From now on you can't rely > on the order of an unordered type like dict or set. Tautologies tend to be true even without a temporal qualification. Stefan -- http://mail.python.org/mailman/listinfo/python-list

lxml 3.0 final released - efficient XML and HTML processing with Python

2012-10-09 Thread Stefan Behnel
n the code base. The lxml.cssselect package was moved into a separate PyPI project nicely extended and maintained by Simon Sapin. If you are interested in commercial support or customisations for the lxml package, please contact me directly. Have fun, Stefan -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   6   7   8   9   10   >