Re: Thoughts on using isinstance

2007-01-24 Thread Maxim Sloyko
On Jan 24, 3:38 pm, "abcd" <[EMAIL PROTECTED]> wrote: > In my code I am debating whether or not to validate the types of data > being passed to my functions. For example > > def sayHello(self, name): > if not name: > rasie "name can't be null" > if not isinstance(name, str): >

lxml namespaces problem

2007-01-07 Thread Maxim Sloyko
Hi All! I have a little problem with XML namespaces. In my application I have two XML processors, that process the same document, one after the other. The first one looks for nodes in 'ns1' namespace, and substitutes them, according to some algorithm. After this processor is finished, it is guara

Re: Mod_python

2006-12-27 Thread Maxim Sloyko
e suggest a solution? The only solution you need is Apache and mod_python :) I mean, Apache won't load a huge POST request into its memory no matter what. All file uploads will be stored in temporary files. Under mod_python (provided you use FieldStorage) you'll need to deal only with &#

Re: your opinion about psycopg vs pygresql

2006-12-21 Thread Maxim Sloyko
Martin P. Hellwig wrote: > However, given the choice, what in your opinion would be the reason why > someone would chose one over the other? Now I know this could easily get > into a flamewar, so if you comment (but please do so) I'll still > investigate that, since at this moment I don't even hav

Re: apache & mod_python

2006-12-08 Thread Maxim Sloyko
m.banaouas wrote: > Can i install and use "Apache 2.2.3" & "mod_python 3.2.10" (most recent > versions) without facing any known major issue ? Works fine for me. The only "known major issue" you can face is general non-threadsafety of Python interpreter. So, if you are using Apache MPM, you have

Re: Javascript is turning into Python?!

2006-11-02 Thread Maxim Sloyko
Paul Rubin wrote: > [Correction of earlier accidental crosspost] > > I hadn't seen this before. New Javascript 1.7 features: > > - Generators > - Iterators > - Array comprehensions > - Destructuring assignment > > Sounds like another language we know. > > http://developer.mozilla.org/en/docs/New_

Re: best way to get data into a new instance?

2006-09-29 Thread Maxim Sloyko
', 'last_name', 'age', 'salary', 'whatever']: self.__dict__[name] = kw.get(name, None) -- Maxim Sloyko -- http://mail.python.org/mailman/listinfo/python-list

Re: Minidom XML output - attributes in wrong order ?

2006-09-05 Thread Maxim Sloyko
u shouldn't rely on the order of attributes in the document in any way, because this is implementation dependent. If you need to preserve order of some items -- use child elements instead of attributes. -- Regards, Maxim Sloyko -- http://mail.python.org/mailman/listinfo/python-list

Re: What do you want in a new web framework?

2006-08-30 Thread Maxim Sloyko
Laurent Pointal wrote: > > Look at http://wiki.python.org/moin/WebFrameworks > > Do you *really* need to develop a *new* framework (maybe a scholl > exercise - it that case, KISS)? Isn't the main reason why there are so many of them is that all of them suck badly? -- http://mail.python.org/mailm

psycopg2 features

2006-08-30 Thread Maxim Sloyko
Hello, clp and all people reading it! Recently I was porting my (small) app from psycopg to psycopg2 (they got me with this "2"). I read, that psycopg2 supports all features of psycopg and plus many more, however, when I started to port, I discovered, that psycopg2 lacks serialized connections and

Re: Best way to handle exceptions with try/finally

2006-05-24 Thread Maxim Sloyko
I guess the following standard method will help : class MyLocker(object): def __init__(self, lock): self.lock = lock self.lock.acquire() def __del__(self): self.lock.release() Then whenever you need to acquire a lock: templock = MyLocker(self.__mutex) del tem

ZSI usage

2006-05-04 Thread Maxim Sloyko
Hi all! I'm trying to make a simple SOAP call from python to SOAP::Lite (perl) SOAP server. My SOAP server has https://myserv.com/open-api URI, the function open_session has the "QW/API" namespace. SO I do the following: from ZSI.client import Binding fp = open('debug.out', 'a') client = Binding

Re: ZSI usage

2006-05-04 Thread Maxim Sloyko
There is a typo there in functions name. It is called "session_open" not "open_session", but everything else is as described -- http://mail.python.org/mailman/listinfo/python-list