Re: After C++, what with Python?

2011-01-16 Thread Stefan Behnel
rom a C++ background, you will happily appreciate how simple programming can be. You will also appreciate learning about Cython, which is the straight forward way for you to write Python code that interfaces with C++ natively. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Python like lanugages

2011-01-17 Thread Stefan Behnel
x27;t tell anything about the skill level of 'the average' JavaScript developer wrt. functional techniques. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-17 Thread Stefan Behnel
hon for purposes of rapid developement and too slow to be competative for non-long-lived tasks. So seriously need to take a look at Cython. http://cython.org Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Need the list of XML parsers

2011-01-17 Thread Stefan Behnel
. Canonical answers: cElementTree and lxml. The first, if you want to use stdlib tools, the second, if you can afford external dependencies. Both are mostly compatible, very fast and memory friendly. lxml has lots of features in addition. Stefan -- http://mail.python.org/mailman/listinfo/python

Re: Need the list of XML parsers

2011-01-17 Thread Stefan Behnel
lxml.etree. That should get you going. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Need the list of XML parsers

2011-01-17 Thread Stefan Behnel
y for you. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-17 Thread Stefan Behnel
cy is done automatically, and Go code doesn't run natively on Windows either, without first installing and running the compiler over it. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: __pycache__, one more good reason to stck with Python 2?

2011-01-18 Thread Stefan Behnel
hat I never found CPython's startup time to be slow, quite the contrary. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: __pycache__, one more good reason to stck with Python 2?

2011-01-18 Thread Stefan Behnel
Peter Otten, 18.01.2011 10:04: What's the advantage of 'find ... | xargs ...' over 'find ... -exec ...'? The former runs in parallel, the latter runs sequentially. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: __pycache__, one more good reason to stck with Python 2?

2011-01-18 Thread Stefan Behnel
up with an orphaned .pyc file, right now and as it was for the last 21 years. The same applies to the new cache directory. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-19 Thread Stefan Behnel
Octavian Rasnita, 19.01.2011 07:10: aren't the Pyton bytecode-compiled files considered secure enough? Can they be easily decompiled? Yes. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-19 Thread Stefan Behnel
Octavian Rasnita, 19.01.2011 11:31: From: "Stefan Behnel" Octavian Rasnita, 19.01.2011 07:10: aren't the Pyton bytecode-compiled files considered secure enough? Can they be easily decompiled? Yes. FYI, just take a look at the 'dis' module. There are also decompil

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-19 Thread Stefan Behnel
Tim Harig, 18.01.2011 12:37: On 2011-01-18, Stefan Behnel wrote: Tim Harig, 17.01.2011 20:41: I prefer a single language as opposed to a creolization of two. With the possible exception of Lisp, I find it hard to think of a language that's still alive and not the creolisation of (at

Re: [Code Challenge] WxPython versus Tkinter.

2011-01-23 Thread Stefan Behnel
t having a rock solid maintainer for both of them is not going to happen. Are you volunteering to maintain both wxPython and wxWidgets in the standard library for, say, twenty years to come? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert XML to SQL

2011-01-26 Thread Stefan Behnel
e the ElementTree API, commonly the findtext() and findall() methods of the root object, to get at the specific record fields. Like this: for _, element in ET.iterparse(fileobject): if element.tag == 'xml_record_tag': title_name = element.findtext('

Re: Convert XML to SQL

2011-01-26 Thread Stefan Behnel
Stefan Behnel, 26.01.2011 10:29: Johann Spies, 26.01.2011 10:07: I an not a Python newbie but working with xml is new to me. I get data through a soap connection, using suds, and want to convert that to objects which I can use to populate a rather complex database. Your problem description

Re: Convert XML to SQL

2011-01-26 Thread Stefan Behnel
Johann Spies, 26.01.2011 13:22: On 26 January 2011 12:51, Stefan Behnel wrote: The example you sent me is almost perfect for lxml.objectify. Basically, you'd do something like this: Thank you very much. You have helped me a lot. You're welcome. If you have any suggestions how

Re: lxml.etree, namespaces and element insertion

2011-01-27 Thread Stefan Behnel
XML after the fact. The only advice I can give: be careful with the default namespace. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: XML to dict(d)

2011-01-31 Thread Stefan Behnel
cana--tA f. voluntary_poverty_as_practised_by_JainajEna_ascetics. 000177 2,2 272 I've found that there is the library python-dictdlib for concatenating dict dictionaries, what would be the best way to "de-XML" the source file? How do you want to the dict to look like? Stefan

Re: XML to dict(d)

2011-01-31 Thread Stefan Behnel
27;, 'H3') for _, element in iterparse('thefile.xml'): if element.tag in h_tags: words[element.findtext('h/key1')] = element Since you didn't provide enough information, I have no idea what you want to make of the "h", "body" and "tail" tags. But I'm sure you'll figure it out. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting getCSS Count Code from java to python

2011-02-02 Thread Stefan Behnel
val(java_script_code)) Although I'd simplify the JavaScript code somewhat to make it a plain expression. If that's not what you want, please be more precise, or look at the CSS selectors in lxml that Jon Clemens pointed you to. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python/C API Inheritance

2011-02-02 Thread Stefan Behnel
to insert the super class struct here, not a plain new object struct. In case you want to avoid stumbling over problems like this and instead concentrate on getting functionality implemented, take a look at Cython. http://cython.org Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Use the Source Luke

2011-02-04 Thread Stefan Behnel
t;. But I must say that I rarely read either of the two being used as common meanings for "practicality" on python-dev. That term is very user focussed in the Python community. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Are Small Dogs Good with Kids?

2011-02-07 Thread Stefan Behnel
Bob Martin, 07.02.2011 08:19: My two terriers absolutely love children. H, tasty ... Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Remove whitespaces and line breaks in a XML file

2011-02-07 Thread Stefan Behnel
or something as generic as an XML parser. What may work for you is to check if an Element has children and only whitespace as text ("not el.text or not el.text.strip()"), and only then replace it by None. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode error in sax parser

2011-02-08 Thread Stefan Behnel
in UTF-8. Parse from a byte string instead, as you do in your fixed code. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Idea for removing the GIL...

2011-02-08 Thread Stefan Behnel
cygwin, it was likely due to the heavy lifting cygwin does in order to emulate fork() on Windows. http://www.cygwin.com/faq/faq-nochunks.html#faq.api.fork Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode error in sax parser

2011-02-09 Thread Stefan Behnel
f._parser.SetBase(source.getSystemId()) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe5' in position 0: ordinal not in range(128) The open(..) part works fine, but there still seems to be a problem inside the sax parser. Did you read my reply? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode error in sax parser

2011-02-09 Thread Stefan Behnel
Stefan Behnel, 09.02.2011 09:58: Rickard Lindberg, 09.02.2011 09:32: On Tue, Feb 8, 2011 at 5:41 PM, Chris Rebert wrote: Here is a bash script to reproduce my error: Including the error message and traceback is still helpful, for future reference. Thanks for pointing it out. #!/bin/sh

Re: Unicode error in sax parser

2011-02-09 Thread Stefan Behnel
. And I agree with Chris Rebert that you should open a bug against the sax package in Python 2.7 on the bug tracker. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Socket connection between python and C

2011-02-09 Thread Stefan Behnel
Williamson, Ross X. wrote: I'm trying to implement a server/client system where the server is written in python and the client has to be written in c/c++. Is this a strict requirement? Could you give us a hint why the client needs to be plain C/C++? Stefan -- http://mail.python.org/ma

Re: Is this a bug of str.join?

2011-02-15 Thread Stefan Behnel
1780339444980186test you can notice that there is no tab between a_id and s Likely just a presentation problem in your terminal. Try with a single space instead of tabs and see the difference. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a bug of str.join?

2011-02-15 Thread Stefan Behnel
result are both the same. What happened to str.join? thanks I'm sorry, I found it should be the terminal width caused visual problem, please kindly ignore this post. Well, there's always this that's worth remembering: http://www.catb.org/~esr/faqs/smart-questions.html#id478549 S

Re: Converting getCSS Count Code from java to python

2011-02-17 Thread Stefan Behnel
ium.get_eval(self, java_script_code)) #return int(selenium.getEval(java_script_code)) You want to use "self.selenium" here, not "selenium". Stefan def setUp(self): self.verificationErrors = [] self.selenium = selenium("localhost&q

Re: Converting getCSS Count Code from java to python

2011-02-17 Thread Stefan Behnel
SMERSH009, 18.02.2011 07:25: On Feb 17, 9:51 pm, Stefan Behnel wrote: SMERSH009, 17.02.2011 22:46: class Untitled(unittest.TestCase): def count_css_matches(self, css_locator): java_script_code = ''' var cssMatches = eval_css("

Re: ctypes from_param() truncating 64 bit pointers to 32 bit

2011-02-18 Thread Stefan Behnel
would explain the 32bit truncation. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes from_param() truncating 64 bit pointers to 32 bit

2011-02-18 Thread Stefan Behnel
bit naive to me. It's correct that all compile time information about function signatures is gone in the library. So you must provide ctypes with the exact signature to allow it to convert your input and output data correctly, and to put the values on the call stack in the correct callin

Re: ctypes from_param() truncating 64 bit pointers to 32 bit

2011-02-18 Thread Stefan Krah
ave the proper function > signature. I suggest that you reconsider, since this appears to work: def from_param(self): return ctypes.c_void_p(self.c_ptr) Stefan Krah -- http://mail.python.org/mailman/listinfo/python-list

Re: [RELEASED] Python 3.2

2011-02-21 Thread Stefan Behnel
has a critical bug in distutils that prevents .pyc files from being byte compiled to their proper location during installation, thus preventing them from being used. http://bugs.python.org/issue11254 Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.2

2011-02-21 Thread Stefan Behnel
ixes are available? You mean: as soon as someone writes a fix? I want to know if I should be on the lookout for a better version of 3.2. Better test now and report any problems you find. (Actually, that's what the beta/RC phase was there for, but it's never too late to find a bug.)

Re: python and parsing an xml file

2011-02-21 Thread Stefan Behnel
sed solution, both for performance and maintainability reasons. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: python and parsing an xml file

2011-02-21 Thread Stefan Behnel
hich is close to the same thing. Hmm, right, good call. There's also the configparser module in the stdlib which may provide a suitable format here. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: python and parsing an xml file

2011-02-21 Thread Stefan Behnel
that to parser = objectify.makeparser(ns_clean=True, remove_comments=True) root = objectify.parse(inputfile,parser) Change that to root = objectify.parse(inputfile,parser).getroot() Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: LDFLAGS problem

2011-02-21 Thread Stefan Krah
lz -lcrypt -lm -o > >> build/lib.freebsd-7.0-RELEASE-i386-2.7/_mysql.so > >> gcc: ${LDFLAGS}: No such file or directory > >> error: command 'gcc' failed with exit status 1 > > > > where should I be looking to fix this problem? Try the patch from http://bugs.python.org/issue10547 or use an svn checkout. The patch didn't make it into 2.7.1. Stefan Krah -- http://mail.python.org/mailman/listinfo/python-list

Re: python and parsing an xml file

2011-02-21 Thread Stefan Behnel
Matt Funk, 21.02.2011 23:40: On 2/21/2011 3:28 PM, Stefan Behnel wrote: Matt Funk, 21.02.2011 23:07: thank you for your advice. I am running into an issue though (which is likely a newbie problem): My xml file looks like (which i got from the internet): Gambardella, Matthew

Re: python and parsing an xml file

2011-02-22 Thread Stefan Behnel
suits your needs. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: python and parsing an xml file

2011-02-22 Thread Stefan Behnel
e an XSLT before hand. CSS is for layout (headings, tables, positioning etc.), XSLT is only needed when you require major structural changes or format conversions, which likely won't be necessary here. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Accelerating For Loop

2011-02-23 Thread Stefan Behnel
mp.append(fiyat) combinations.append(temp) For this kind of computation, Cython is usually much faster than NumPy by itself. http://cython.org/ http://docs.cython.org/src/tutorial/numpy.html http://docs.cython.org/src/userguide/numpy_tutorial.html Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: lxml

2011-02-24 Thread Stefan Behnel
table release" (that would be 2.3), but at least one that's pre-built for Windows. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a standard name for this tree structure?

2010-04-04 Thread Stefan Behnel
ython Maybe not quite what you asked for, but given the names in the example above I would call this an ontology. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: python grep

2010-04-08 Thread Stefan Behnel
basically impossible to beat the speed of (f)grep. I'd use the subprocess module to run zfgrep over the file and parse the output in Python. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: python grep

2010-04-08 Thread Stefan Behnel
Mag Gam, 08.04.2010 14:21: On Thu, Apr 8, 2010 at 7:31 AM, Stefan Behnel wrote: Mag Gam, 08.04.2010 13:21: I am in the process of reading a zipped file which is about 6gb. I would like to know if there is a command similar to grep in python because I would like to emulate, -A -B option of

Re: SIP

2010-04-08 Thread Stefan Behnel
omnia neo, 09.04.2010 07:01: import siptest I get following error : import error : no module named siptest Is the directory where your siptest.dll lies in your PYTHONPATH (sys.path)? Otherwise, Python can't find it. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: The Regex Story

2010-04-09 Thread Stefan Behnel
plain about problems that are easy to solve with the solution at hand. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: The Regex Story

2010-04-09 Thread Stefan Behnel
me.compile("{^g.?+*y:h}|\Y^r&(?P:2+)|\w+(x&y)|[?#\s]").solve() Actually, I would expect that the result of any mathematical calculation can be found by applying a suitable regular expression to pi. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Performance of list vs. set equality operations

2010-04-10 Thread Stefan Behnel
ity of two lists. If you want to influence the equality, you need to override __eq__. If you don't, the original implementation is free to do whatever it likes to determine if it is equal to another value or not. If it uses __len__ for that or not is only an implementation detail that can't be relied upon. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Regular Expressions

2010-04-10 Thread Stefan Behnel
e commands manually, even if you can. It's perfectly ok to write the program in Python instead. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: finding objects in a piece of functional code ?

2010-04-11 Thread Stefan Behnel
u describe why you want such a language in the first place? What feature do you need that cannot be expressed using doctests, for example? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: universal newlines and utf-16

2010-04-11 Thread Stefan Behnel
#x27;, 'utf-16').read()) "u'a\\n\\nb\\n\\n'" of course, the output i want is: "u'a\\nb\\n'" i suppose it's not too surprising that the built-in open converts the line endings before decoding, but it surprised me that codecs.open does this as well. The codecs module does not support universal newline parsing (see the docs). You need to use the new io module instead. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: About Python execution speed

2010-04-12 Thread Stefan Behnel
to about 45 seconds. What is the reason of this improvement? Local variables in a function can be accessed much faster than globally defined names (which require a dictionary lookup). This is a good thing because the access to local variables tends to be much more performance critical than

Re: Question about LLVM

2010-04-12 Thread Stefan Behnel
Hannes, 12.04.2010 12:56: I heard that its possible to use LLVM to speed up Python. Can anybody explain to me, how that works? http://code.google.com/p/unladen-swallow/ Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Write web apps in Python?

2010-04-12 Thread Stefan Behnel
s of other options, as already pointed out. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: HTMLParser can't read japanese

2010-04-13 Thread Stefan Behnel
open() function for that). Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Handling quotes in xml.dom text nodes

2010-04-13 Thread Stefan Behnel
Chaim Krause, 13.04.2010 17:26: I am building a web page (HTML 4.01 Transitional) using xml.dom.minidom. I have created a

Re: how to get text from a html file?

2010-04-13 Thread Stefan Behnel
help me with this? E.g. using lxml.html: import lxml.html as H html = H.parse("the_html_file.html") print H.tostring(html, method="text") Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get text from a html file?

2010-04-13 Thread Stefan Behnel
e way to go"? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get text from a html file?

2010-04-14 Thread Stefan Behnel
Emile van Sebille, 14.04.2010 15:24: On 4/13/2010 11:43 PM Stefan Behnel said... rake, 14.04.2010 02:45: On Apr 13, 2:12 pm, Chris Colbert wrote: You should look into beautiful soup http://www.crummy.com/software/BeautifulSoup/ For more complex parsing beautiful soup is definitely the way

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Stefan Behnel
want to tell us what that job is, so that we can point you to a suitable tool. Usually, parsing is only one part of a program that deals with XML. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Stefan Behnel
Shashwat Anand, 15.04.2010 11:55: > BeautifulSoup The OP asked for an XML parser. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Stefan Behnel
Shashwat Anand, 15.04.2010 12:29: On Thu, Apr 15, 2010 at 3:50 PM, Stefan Behnel wrote: Shashwat Anand, 15.04.2010 11:55: BeautifulSoup The OP asked for an XML parser. BeatifulSoup can be used as one IMO But it is not an XML parser according to the XML spec. So giving the impression

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Stefan Behnel
t's also in the stdlib. If you need more powerful features, take a look at lxml.etree, which is a (mostly) compatible external package. > By the way, besides is there any great book for > learning python? That has been answered many times on this list. Check the archives, or look through th

Re: Reactive programming in Python ?

2010-04-16 Thread Stefan Behnel
with the "any" builtin than with the "sum" builtin. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Reactive programming in Python ?

2010-04-16 Thread Stefan Behnel
pca, 16.04.2010 22:02: On Apr 16, 8:28 pm, Stefan Behnel wrote: pca, 16.04.2010 17:18: In fact, I have seeded an open-source project, Yoopf, that enables programming by formula within Python, with the goal of dramatically accelerating the development of the model view in the MVC model

Re: extract substring by regex from a text file

2010-04-17 Thread Stefan Behnel
first. The latter will read all lines into a big list in memory before doing any further processing, whereas the plain for-loop will read line by line and let the loop body act on each line immediately. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Usable street address parser in Python?

2010-04-18 Thread Stefan Behnel
thing in the first place). Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Code redundancy

2010-04-20 Thread Stefan Behnel
since you mention that you "often" find yourself doing the above, you may also have a mental design problem somewhere. We can't tell unless you provide a more concrete example than what you show above. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: xml.dom.minidom character encoding

2010-04-21 Thread Stefan Behnel
decs.open() in favour of f = open("foo.xml", "wb") (mind the 'b' in the file mode, which stands for 'bytes' or 'binary') Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: a.extend(b) better than a+=b ?

2010-04-22 Thread Stefan Behnel
; a+=l; a+=l" 1 loops, best of 3: 151 usec per loop $ python2.6 -m timeit -s "l=range(1)" \ "a=l[:]; a.extend(l); a.extend(l)" 1000 loops, best of 3: 164 usec per loop Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python3] Reading a binary file and wrtiting the bytes verbatim in an utf-8 file

2010-04-24 Thread Stefan Behnel
to write to the same file, and doesn't rely on any specific coordination between those two interfaces. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help with basic DOM XML tree traversing

2010-04-25 Thread Stefan Behnel
child_nodes.childNodes) By convention, the underscore at the beginning of "_get_childNodes" indicates that it is not considered a public method. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Engineering numerical format PEP discussion

2010-04-26 Thread Stefan Krah
al/decarith.pdf > (to-engineering-string is on page 20 if you're interested) The module is correct. Printing without exponent follows the same rules as to-scientific-string: "If the exponent is less than or equal to zero and the adjusted exponent is greater than or equal to -6,

Re: Engineering numerical format PEP discussion

2010-04-26 Thread Stefan Krah
.2/decimal.py", line 3836, in _raise_error raise error(explanation) decimal.InvalidOperation: Invalid literal for Decimal: 'wrong' >>>c.traps[InvalidOperation] = False >>> Decimal("wrong", c) Decimal('NaN') Stefan Krah -- http://mail.python.org/mailman/listinfo/python-list

Re: SWIG + expy

2010-04-27 Thread Stefan Behnel
mailing list (you might want to search the archives). The main theme seems to be that clang provides a suitable parser, and several people have used it to write up a code generator for their specific needs (you might want to look at those). Stefan -- http://mail.python.org/mailman/listinfo/python

Re: Python 2.X vs. 3.X - level of acceptance?

2010-04-27 Thread Stefan Behnel
f your way another little bit more than Py2. It's also less outdated cruft to talk about, e.g. old-style classes are gone, unicode issues are mostly gone or at least easier to explain (and worth explaining when they occur). It's just more fun to work with. :) Just my two €-cents.

Re: SWIG + expy

2010-04-27 Thread Stefan Behnel
Yingjie Lan, 28.04.2010 05:53: From: Stefan Behnel Yingjie Lan, 27.04.2010 08:30: Is it possible to use SWIG to parse C/C++, and provide an interface for me to generate some code? I thought it might be good to have SWIG help generate expy files, then generate the python extension via expy

Re: Ignoring XML Namespaces with cElementTree

2010-04-28 Thread Stefan Behnel
? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: matching strings in a large set of strings

2010-04-29 Thread Stefan Behnel
than this? Try one of the dbm modules in the stdlib. They give you dictionary-like lookups on top of a persistent database. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Ignoring XML Namespaces with cElementTree

2010-04-29 Thread Stefan Behnel
large files I seriously doubt that they do. (first cElementTree adds them, then I have to remove them in python). I think that's your main mistake: don't remove them. Instead, use the fully qualified names when comparing. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: replacing words in HTML file

2010-04-29 Thread Stefan Behnel
he above code and remove the need for a global variable. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Accessing an instance of a class from within instance of another class

2010-04-30 Thread Stefan Krastanov
def SomeOtherFunction(self): self.Data.something() It's an ugly way to implement a pointer or something like it. What is the right way? Cheers Stefan Krastanov P.S. Maybe it's bad idea to use two different view classes, but that is another question. P.P.S. Maybe I'm breaking the

Re: Python dot-equals (syntax proposal)

2010-04-30 Thread Stefan Behnel
ntax changes will be accepted for at least 24 months starting from the release date of Python 3.1. See more details here: http://www.python.org/dev/peps/pep-3003/ In any case, the right place to discuss this is the python-ideas list. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Ignoring XML Namespaces with cElementTree

2010-04-30 Thread Stefan Behnel
s me desired tags without stinking URIs. You should try to calm down and embrace this feature. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Ignoring XML Namespaces with cElementTree

2010-05-01 Thread Stefan Behnel
Carl Banks, 01.05.2010 12:33: On Apr 29, 10:12 pm, Stefan Behnel wrote: dmtr, 30.04.2010 04:57: I don't want these "{http://www.very_long_url.com}"; in front of my tags. They create performance disaster on large files I seriously doubt that they do. I don't know what k

Re: matching strings in a large set of strings

2010-05-01 Thread Stefan Behnel
64bit system, versus 1 byte per character in a byte string list. Depending on the ratio of branches to characters, one or the other may win. So a "naive approach" likely won't work for tries either. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python dot-equals (syntax proposal)

2010-05-01 Thread Stefan Behnel
57:41) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> l = [1,2,3] >>> a = l >>> l += [4,5,6] >>> l [1, 2, 3, 4, 5, 6] >>> a [1, 2, 3, 4, 5, 6] And I'm pretty sure this wasn't just done for performance reasons. Mutable data types behave that way. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: [capi-sig] SWIG + expy

2010-05-01 Thread Stefan Behnel
st keeping subsequent discussion there. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Parser

2010-05-02 Thread Stefan Behnel
because it has excellent GUI (the quality of which is amazing). See? Explanations help more than bold statements. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: new extension generator for C++

2010-05-03 Thread Stefan Behnel
al library wrappers. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: new extension generator for C++

2010-05-04 Thread Stefan Behnel
s. It has been subject to serious benchmarking and optimisations. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get xml.etree.ElementTree not bomb on invalid characters in XML file ?

2010-05-04 Thread Stefan Behnel
o ignore the invalid characters. Could you suggest a way to call ElementTree, so it won't bomb on these invalid characters ? No. The parser in lxml.etree has a 'recover' option that lets it try to recover from input errors, but in general, XML parsers are required to reject non w

<    13   14   15   16   17   18   19   20   21   22   >