Re: status of Programming by Contract (PEP 316)?

2007-08-29 Thread Michele Simionato
ou need (unittest, doctest, py.test, nose, ...) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: status of Programming by Contract (PEP 316)?

2007-08-30 Thread Michele Simionato
it has already happened). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: status of Programming by Contract (PEP 316)?

2007-08-31 Thread Michele Simionato
"I think DbC is good" and I said "I don't think so". I would not call that an attack. If you want to see an attack, wait for Alex replying to you observations about the low quality of code at Google! ;) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Google spreadsheets

2007-08-31 Thread Michele Simionato
I would like to upload a tab-separated file to a Google spreadsheet from Python. Does anybody have a recipe handy? TIA, Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: metaclasses: timestamping instances

2007-09-01 Thread Michele Simionato
ade up) example where .__metaclass__ gives the wrong result: In [9]: class M(type): pass ...: In [10]: class B: __metaclass__ = M : In [11]: B.__metaclass__ = None # now the hook is set to None, but the metaclass does not change In [12]: B.__class__ Out[12]: Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: status of Programming by Contract (PEP 316)?

2007-09-01 Thread Michele Simionato
On Sep 2, 7:05 am, Russ <[EMAIL PROTECTED]> wrote: > Someone please correct me if I am wrong, > but I think PEP adds only to the libraries. You are wrong, PEPs also add to the core language. Why don't you give a look at the PEP parade on python.org? Michele Si

Re: Google spreadsheets

2007-09-02 Thread Michele Simionato
On Sep 2, 7:13 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > iapain <[EMAIL PROTECTED]> wrote: > > On Aug 31, 5:40 pm, Michele Simionato <[EMAIL PROTECTED]> > > wrote: > > > I would like to upload a tab-separated file to a Google spreadsheet > > >

Re: Will Python 3.0 remove the global interpreter lock (GIL)

2007-09-03 Thread Michele Simionato
#x27;processing' module in PyPI. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: How does super() work?

2007-09-03 Thread Michele Simionato
> En Fri, 31 Aug 2007 17:58:24 -0300, Lamonte Harris <[EMAIL PROTECTED]> > escribi?: > > > I've searched Google, and other search engines to try to find out how > > super() works. Can someone explain in short detail how super() works? I > > may and may not need to know this information, but it is

Re: programming by contract using "decorators"

2007-09-03 Thread Michele Simionato
is already > exists, please let me know. Thanks. Check out the decorator module at http://www.phyast.pitt.edu/~micheles/python/documentation.html Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: doctest and decorators

2007-09-04 Thread Michele Simionato
corated function, my problem is running doctests on functions using an > > imported decorator. Having to implement the decorator in every source > > module > > isn't very practical. I cannot reproduce your problem. Using functools.wraps the __module__ attribute is set cor

Re: decorator and signal handler

2007-09-05 Thread Michele Simionato
r.signal = lambda : os.kill(os.getpid(), sig) return handler return handler_decorator Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: doctest and decorators

2007-09-05 Thread Michele Simionato
ugh > >>> test() > 'works!' > """ > return "works!" > > if __name__ == '__main__': > import doctest > doctest.testmod() > Ok, I could not see the code before (Google groups as getting worse as the time goes by). It looks like you are right, it is a bug in doctest. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Multi Heritage with slots

2007-09-05 Thread Michele Simionato
e way to do what the original poster wants: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252158 Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: How to do python and RESTful

2007-09-06 Thread Michele Simionato
if meth == 'DELETE': ... else: raise ValueError('Unknown HTTPMethod %r!!' % meth) ... Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: concise code (beginner)

2007-09-06 Thread Michele Simionato
def a0040(): global self; self.disablePLmessages([self.dev]); > def a0050(): global self; self.dev.testH.writePLram((PL.BCAL12<<8)); Look at generative tests in py.test or nose: they are a much better solution for what you are doing. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic GUI

2007-09-11 Thread Michele Simionato
including to non-multi-process solutions. > > Thanks for your comments, I searched old posts for a while, various > other Python info-sources, and couldn't find an answer. > -- > don Have a look at the 'processing' module. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: An ordered dictionary for the Python library?

2007-09-12 Thread Michele Simionato
e built-in dict. Nonetheless, I still find it > worth using for the convenience it offers. > > Do other Python programmers feel this lack? Is this worth a PEP? > Yes, this is a serious lack in the standard library. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Michele Simionato
cal code full of > 'self.'s breaking up the equations. You can always use aliases a = self.a u = self.u ... or even s = self or play games with dictionaries. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: An ordered dictionary for the Python library?

2007-09-12 Thread Michele Simionato
On Sep 12, 2:42 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Wed, 12 Sep 2007 07:33:45 +, Mark Summerfield wrote: > In fact, I'm not sure what people mean by ordered dicts. I assume they > mean the keys are ordered, not the values. But ordered by what? Insertion > orde

Re: An ordered dictionary for the Python library?

2007-09-12 Thread Michele Simionato
On Sep 12, 3:54 pm, Mark Summerfield <[EMAIL PROTECTED]> wrote: > On 12 Sep, 13:46, Michele Simionato <[EMAIL PROTECTED]> > > Actually I meant by key order, so insertion order doesn't matter at > all. If you need a dictionary-like data structure that respects > inse

Re: Dynamically removing methods in new-style classes

2007-09-12 Thread Michele Simionato
ass of the instance, or to play trick such as def removed_method(self): raise NotImplementedError self.test1 = removed_method.__get__(self) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Michele Simionato
ferent name to it: for instance it becomes cls when you are inside a classmethod. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Michele Simionato
s.dis(co1) print 'bytecode for test2' dis.dis(co2) t = Test() assert t.test1() == t.test2() It is still a hack, since one is not supposed to mess around with bytecodes, but at least it seems to work ;) [warning: I have not tested it more than you see] Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Project organization and import

2007-03-06 Thread Michele Simionato
ious version, not on the reloaded version, but you cannot pretende miracles from reload! ;) You can also look at Michael Hudson's recipe http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/160164 for a clever approach to automatic reloading. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Descriptor/Decorator challenge

2007-03-08 Thread Michele Simionato
r n, v in dic.iteritems(): if isinstance(v, FunctionType): dic[n] = addlocalvar(v, 'CurrentClass', name) return super(_CurrentClassEnabled, mcl).__new__(mcl, name, bases, dic) class CurrentClassEnabled: __metaclass__ = _CurrentClassEnabled Enjoy!

Re: Descriptor/Decorator challenge

2007-03-08 Thread Michele Simionato
is kind of games is for prototyping in current Python features that are candidate for inclusion in future versions of Python, but this was what Raymond asked. However, there is also the fun of it ;) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this right? Multiple imports of same module.

2007-03-09 Thread Michele Simionato
On Mar 9, 5:18 pm, Lou Pecora <[EMAIL PROTECTED]> wrote: > I have noticed that using from xxx import * can lead to problems when > trying to access variables in the xxx module. ``from xxx import *`` is intended to be used in the interactive interpreter only. Michele Simiona

Re: Putting Metaclasses to Work

2007-03-12 Thread Michele Simionato
is the way I bought it from Amazon 5 years ago (dunno if it is still available now, but you never know). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

nonlinear interpolation

2007-03-12 Thread Michele Simionato
received :) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

nonlinear interpolation

2007-03-12 Thread Michele Simionato
received :) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

nonlinear interpolation

2007-03-12 Thread Michele Simionato
received :) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: nonlinear interpolation

2007-03-12 Thread Michele Simionato
On Mar 12, 5:28 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > "Michele Simionato" <[EMAIL PROTECTED]> writes: > > Any pointer would be well received :) > > Dunno about those libs but it helps to understand the mathematical > options. Numerical Recip

Re: How to calculate a file of equations in python

2007-03-19 Thread Michele Simionato
()).replace('\n','')) Or use one of the many safe_eval recipes out there, for instance http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/364469 Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Fortran vs Python - Newbie Question

2007-03-26 Thread Michele Simionato
rtran because of its a high level > language nature, so what are the advantages of using Python for > creating number crunching apps over Fortran?? > Thanks > Chris The standard way is to perform the number crunching in Fortran and to use Python as glue. See for instance the scipy proje

Re: Classes with initialization

2007-04-09 Thread Michele Simionato
_ does not seem to get > the code in A's class scope in its arguments AFAICS, so I guess that > code is run before the class is created? > > Cheers, > __init__ is run after class creation. What does not work exactly? Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: super() doesn't get superclass

2007-09-18 Thread Michele Simionato
hink I even filed a documentation bug for that years ago, and I wrote an entire paper on the subject that however I never published since I never felt 100% confident with super (and I had other fishes to fry ;) I realize now that I was wrong in not publishing it. You can find the draft (warning: it

Re: super() doesn't get superclass

2007-09-19 Thread Michele Simionato
itself is certainly something we do want to keep, whatever > some may argue. Well, I am personally *against* multiple inheritance (i.e. IMO it gives more troubles than advantages) > > The goal is to call the correct "next" method according to MRO. Indeed, > it could have bee

Re: super() doesn't get superclass

2007-09-19 Thread Michele Simionato
that the order of the methods depends on the second argument to super, the instance, so there is no useful concept of the superclass of the first argument of super. I rest my case. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: super() doesn't get superclass

2007-09-19 Thread Michele Simionato
somewhere very near here, what is > misleading is the prominence of A, which isn't really the most > important class involved.) > Happily A (and B too) will become invisible in Python 3000. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: super() doesn't get superclass

2007-09-19 Thread Michele Simionato
On Sep 19, 8:14 pm, Ed Leafe <[EMAIL PROTECTED]> wrote: > On Sep 19, 2007, at 6:52 AM, Michele Simionato wrote: > > > Well, I am personally *against* multiple inheritance (i.e. IMO it > > gives more troubles than advantages) > > For the sorts of examples that

Re: Mixin classes and single/multiple inheritance (was: super() doesn't get superclass)

2007-09-19 Thread Michele Simionato
On Sep 20, 4:55 am, Ben Finney <[EMAIL PROTECTED]> wrote: > Michele Simionato <[EMAIL PROTECTED]> writes: > > I am not against mixins (even if I am certainly very much against > > the *abuse* of mixins, such as in Zope 2). What I would advocate > > (but I rea

Re: Mixin classes and single/multiple inheritance

2007-09-19 Thread Michele Simionato
g us very little for the point of view of mixins; OTOH, multiple inheritance is giving us a lot of headaches for what concerns cooperative methods. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Mixin classes and single/multiple inheritance

2007-09-19 Thread Michele Simionato
On Sep 20, 5:41 am, Ben Finney <[EMAIL PROTECTED]> wrote: > Michele Simionato <[EMAIL PROTECTED]> writes: > > Ben Finney wrote: > > > What do you see as an appropriate use of mixin classes, and what > > > an abuse? > > > An example of fine usage of

Re: Mixin classes and single/multiple inheritance

2007-09-19 Thread Michele Simionato
On Sep 20, 6:52 am, Ben Finney <[EMAIL PROTECTED]> wrote: > Michele Simionato <[EMAIL PROTECTED]> writes: > > Since the language we have does have multiple inheritance, let's > > use it to implement mixins. > > ... > > So, multiple inheritance is giving

Re: super() doesn't get superclass

2007-09-20 Thread Michele Simionato
On Sep 20, 4:31 pm, "Marshall T. Vandegrift" <[EMAIL PROTECTED]> wrote: > Michele Simionato <[EMAIL PROTECTED]> writes: > > I am not against mixins (even if I am certainly very much against the > > *abuse* of mixins, such as in Zope 2). What I would advocate

Re: Can a base class know if a method has been overridden?

2007-09-24 Thread Michele Simionato
_name = [base for base in bases if hasattr(base, nam)] if any_base_has_name: print "AlreadyDefinedNameWarning: " + nam return type(name, bases, dic) f = sys._getframe(1) f.f_locals["__metaclass__"] = makecls Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Yet another comparison of Python Web Frameworks

2007-10-06 Thread Michele Simionato
do not speak too well of Pylons, so if you thing I am wrong feel free to correct me here ;) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Yet another comparison of Python Web Frameworks

2007-10-06 Thread Michele Simionato
id. For instance, if you Google a bit you should find the rants of the Quixote people against Zope. I share their position. I did not talk about TG because I see it as being very close to Pylons and everybody is saying they will be unified in the near future, so it would be a waste of effort to discuss TG per se. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Yet another comparison of Python Web Frameworks

2007-10-06 Thread Michele Simionato
erious test of SQLAlchemy for a couple of years, but never found the time :-( Do you (or something else) have something to say about Beaker? I looked at the source code and it seems fine to me, but I have not used it directly, not stressed it. I need a production-level WSGI session middleware and

Re: Yet another comparison of Python Web Frameworks

2007-10-06 Thread Michele Simionato
On Oct 6, 12:57 pm, Bruno Desthuilliers > Michele Simionato a écrit : > > > I looked at the source code and it seems fine to me, but I have > > not used it directly, not stressed it. I need a > > production-level WSGI session middleware and I wonder what the > >

Re: Yet another comparison of Python Web Frameworks

2007-10-07 Thread Michele Simionato
so for the moment I think they will stay in Zope. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Yet another comparison of Python Web Frameworks

2007-10-07 Thread Michele Simionato
nguage should be a non issue. Any half > decent framework should allow you to use any other templating engine > with ease. > ... even python as you seem to prefer > Yes, the choice of templating language is a non-issue. Maybe I should have removed my considerations on the subject in my es

Re: weakrefs and bound methods

2007-10-07 Thread Michele Simionato
at recently Raymond Hetting said in this list that he wanted to submit a PEP to remove __del__ from Python 3000 (I don't know if this will ever happen tough). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: weakrefs and bound methods

2007-10-07 Thread Michele Simionato
On Oct 7, 1:14 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sun, 07 Oct 2007 16:38:23 +, Michele Simionato wrote: > > On Oct 7, 12:26 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > >> Drop all those

Re: weakrefs and bound methods

2007-10-07 Thread Michele Simionato
On Oct 7, 11:28 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 07 Oct 2007 12:55:29 -0700, Alex Martelli wrote: > >> What should I do when my objects need to perform some special > >> processing when they are freed, if I shouldn't use __del__? > > > The solid, reliable way is: > > > from

Re: Don't use __slots__ (was Re: Problem of Readability of Python)

2007-10-07 Thread Michele Simionato
On Oct 8, 12:27 am, [EMAIL PROTECTED] (Aahz) wrote: > > Aaaugh! Don't use __slots__! +1 QOTW ;) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem of Readability of Python

2007-10-07 Thread Michele Simionato
e just a question: suppose I want to measure the memory allocation of a million of records made with ctypes vs the memory allocation of equivalent records made with __slots__, how do I measure it? Say on Linux, Mac and Windows? If ctypes records are more efficient than __slots__ records, I will ask for deprecation of __slots__ (which is something I wanted from the beginning!). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Yet another comparison of Python Web Frameworks

2007-10-07 Thread Michele Simionato
On Oct 7, 6:14 pm, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Oct 7, 12:24 pm, Michele Simionato <[EMAIL PROTECTED]> > wrote: > > > Here we disagree: I think that a programmer should know what he > > is using. > > My point was that they should not *need*

Re: Yet another comparison of Python Web Frameworks

2007-10-10 Thread Michele Simionato
On Oct 10, 5:57 am, [EMAIL PROTECTED] wrote: > Since you are starting a new project you may want to look into > something new and different > > http://mdp.cti.depaul.edu/examples Well, the name is certainly appealing to an old gauge field theorist like myself ;) Michele Simiona

Re: Yet another comparison of Python Web Frameworks

2007-10-10 Thread Michele Simionato
4 because of some C libraries I need, so I cannot even consider a framework based on Python 2.5 for the moment :-( Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Keeping track of subclasses and instances?

2007-10-10 Thread Michele Simionato
ipe does what you want, with the intent of providing automatic finalization of the instances, but you should be able to tweak it to do everything you wish: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/523007 Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Keeping track of subclasses and instances?

2007-10-11 Thread Michele Simionato
f this little issue with the cleanup mechanism (which BTW is shared also by the weak references callback mechanism). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Yet another comparison of Python Web Frameworks

2007-10-12 Thread Michele Simionato
On Oct 12, 10:23 pm, Massimo Di Pierro <[EMAIL PROTECTED]> wrote: > > P.S. Michele Simionato. I have heard your name before? Is it possible > we have met in Pisa in 1990-1996? I am also a Quantum Field Theorist > and there is not many of us. That is definitely possible, even i

Paste and WSGI 2.0 [WAS: Yet another comparison of Python Web Frameworks]

2007-10-14 Thread Michele Simionato
an to support it in Paste and if yes when (I mean, in a month, in a year, in three years?) 3. if you already have thought of a migration plan and, in that case, what your strategy would likely be. Thanks for sharing, Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Twisted (or for loops ?) madness

2007-10-15 Thread Michele Simionato
browse this list you will find many discussions. Basically if you do funclist = [] for i in 1,2,3: def f(): print i funclist.append(f) you will get funclist[0]() == funclist[1]() == funclist[2]() == 3 (you get the latest binding of "i"). As you see, it has nothing to do with lamb

Re: Twisted (or for loops ?) madness

2007-10-15 Thread Michele Simionato
: def f(i=i): print i funclist.append(f) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Integrating a GUI with an asyncore-based server

2007-10-16 Thread Michele Simionato
Which is the best approach to use in such case? > Could someone point me in the right direction? Twisted has Tkinter integration. If you don't want to use Twisted, you could run the asyncore loop in a separated thread with respect to the Tkinter mainloop. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Noob questions about Python

2007-10-17 Thread Michele Simionato
umber, int) and number >= 0 b = [] while number: b.append(str(number % N)) number /= N return ''.join(reversed(b)) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Noob questions about Python

2007-10-18 Thread Michele Simionato
""" > > assert 2 <= N <= 10 > > assert isinstance(number, int) and number >= 0 > > if number == 0: > return "0" > > > b = [] > > while number: > > b.append(str(number % N)) > >

Re: CGI Server that supports redirects

2007-10-19 Thread Michele Simionato
also included with Paste? Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Bypassing __getattribute__ for attribute access

2007-10-26 Thread Michele Simionato
ks to Bruno and the others you know everything about attribute access in Python. Still, you may be interested in this recipe, which involves __setattr__ and non __getattribute__: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252158 Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: AOP and pep 246

2007-11-01 Thread Michele Simionato
. > > What?? > > Can someone please throw some light on whats the current state of the art? See http://www.python.org/dev/peps/pep-3119 Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: AOP and pep 246

2007-11-01 Thread Michele Simionato
had no success, but pearls of PEAK are having an enormous impact. This is yet another example of "simple is better than complex" and the ultimate reason why AOP a la Java was a dead idea from the beginning. Too invasive. If you want to have success, you must start from simple things. Mich

Re: Adding GNU Readline after installation?

2007-11-02 Thread Michele Simionato
t my "up arrow" history working... Google for "rlwrap". Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: (newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-10 Thread Michele Simionato
abily use the traditional registry you discussed before (too much magic here). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorators inside of class and decorator parameters

2007-01-14 Thread Michele Simionato
func, create=False) works exactly as functools.update_wrapper (i.e. copies__doc__, __module__,etc. from func to wrapper without preserving the signature), whereas update_wrapper(wrapper, func, create=True) creates a new wrapper with the right signature before copying the attributes. Michele

Re: Python web app. (advice sought)

2007-01-15 Thread Michele Simionato
rver which is in the standard library (starting from Python 2.5+), have a look at Paste and write your own solution. At the least this is the way I did it. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Watch log

2007-01-15 Thread Michele Simionato
(f, textwidget): textwidget.insert('end', f.readline()) textwidget.after(interval, displayfile, f, textwidget) if __name__ == '__main__': st = ScrolledText() st.pack() displayfile(sys.stdin, st) st.mainloop() $ python showlog.py < mylogfile.log

Re: arguments of a function/metaclass

2007-01-16 Thread Michele Simionato
list. > > > I am sure there is an elegant way how to do this, could you give me any > hints??? > def __init__(self, **kw): vars(self).update(kw) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Dejavu 1.5.0RC1

2007-01-24 Thread Michele Simionato
I am curious ... how this compare to SQLAlchemy? Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: instancemethod

2007-01-26 Thread Michele Simionato
, Ian Bicking) asking to fix that. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: instancemethod

2007-01-26 Thread Michele Simionato
n (other than in the test suite). However, class methods are still useful in other places, for example, to program inheritable alternate constructors. """ So, I stand my point. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Web File System

2007-01-29 Thread Michele Simionato
nt Management Systems such as Zope for this kind of things. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Any python scripts to do parallel downloading?

2007-01-31 Thread Michele Simionato
cycle.next().next() except StopIteration: pass root.after(50, next, cycle) root.after(0, next, itertools.cycle(downloader.downloads)) root.mainloop() Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Any python scripts to do parallel downloading?

2007-01-31 Thread Michele Simionato
esort to kill -9, and I *hate* that. Especially since kill -9 does not honor try .. finally statements. In short, I prefer to avoid threads, *especially* for the simplest things. I use threads only when I am forced to, typically when I am using a multithreaded framework interacting with a dat

Re: Any python scripts to do parallel downloading?

2007-01-31 Thread Michele Simionato
d is a three-liner, but it is not already there, nor standard :-( Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: how do I pipe two processes?

2007-02-01 Thread Michele Simionato
quot;IOError: bad file descriptor" from Python, and broken pipe > error from program_b. How do I do this right? > > Thanks, > Bahadir Use the subprocess module, see the examples here: http://docs.python.org/dev/lib/node539.html Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Any python scripts to do parallel downloading?

2007-02-01 Thread Michele Simionato
On Feb 1, 1:43 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On 31 Jan 2007 22:02:36 -0800, Michele Simionato <[EMAIL PROTECTED]> wrote: > >Another thing I miss is a facility to run an iterator in the Tkinter > >mainloop: since Tkinter is not thread-safe, >

Re: huge amounts of pure Python code broken by Python 2.5?

2007-02-06 Thread Michele Simionato
; into the same problem at all, so I'm curious.) > > Steve I have seen breakage in Zope, due to the switch from old-style exceptions to new-style exceptions. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Partial 1.0 - Partial classes for Python

2007-02-07 Thread Michele Simionato
same reason I don't like excessive inheritance, it is too easy to get lost when debugging code written by somebody else. But probably I am just overreacting due to my exposure to Zope ... Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Object type check

2007-02-07 Thread Michele Simionato
ice that checking for the existance of the needed method is better than using isinstance, since it gives you much more freedom for innerobj. Do not require more than you need. HTH, Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Object type check

2007-02-08 Thread Michele Simionato
ing on here ? I mean, what is actually > happens if you omit the parenethesis as you just did ? I understand > that it does not call the method, but what is really doing ?? See http://users.rcn.com/python/download/Descriptor.htm for more than you ever wanted to know about attribute access i

Re: Partial 1.0 - Partial classes for Python

2007-02-08 Thread Michele Simionato
turns have their own attributes, and so on. In other words, nested is better than flatten ;) Michele Simionato P.S. Of course I mean situations where the methods can be meaningfully grouped together, which I find is the most common case. -- http://mail.python.org/mailman/listinfo/python-list

Re: Partial 1.0 - Partial classes for Python

2007-02-08 Thread Michele Simionato
On Feb 8, 4:05 pm, [EMAIL PROTECTED] wrote:> > Composition is great when you know how largish classes are going to be > composed ahead of time and/or already have the pieces available in the form > of other classes you want to reuse. I use this fragment-by-multiple- > inheritance (I hesitate to ca

Re: Partial 1.0 - Partial classes for Python

2007-02-08 Thread Michele Simionato
th): setattr(cls, meth.__name__, meth) return meth return attach_meth @attach_to(pointer_to_c) @classmethod def from_param(cls, value): ... do something ... Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Please recommend library for multithread download

2007-02-10 Thread Michele Simionato
look at this recent thread: http://groups.google.com/group/comp.lang.python/browse_frm/thread/77fc9888e43bac46/1df3bcbfb785395c?lnk=gst&q=download+simionato&rnum=1&hl=en#1df3bcbfb785395c Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple inheritance of a dynamic list of classes?

2007-02-12 Thread Michele Simionato
inner object. Hope you can find some useful trick for solving your problem. Michele Simionato import sys, cmd, traceback, inspect try: # Python 2.5 from functools import update_wrapper except ImportError: def update_wrapper(wrapper, wrapped, assigned

Re: Fast constant functions for Py2.5's defaultdict()

2007-02-14 Thread Michele Simionato
use them int if the constant was zero and lambda otherwise. If they wanted to use itertools.repeat(const).next they should prove me that the speed increase is absolutely significant in their actual use case and they should put a big comment in the code explaining why they preferred the cryptic defau

Re: multiple inheritance of a dynamic list of classes?

2007-02-15 Thread Michele Simionato
works, but when you start having dozens of methods inherited from different sources, your code will become to look as spaghetti code. This is why in general I (as many people here) suggest delegation over inheritance. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   >