Re: multiple inheritance super()

2005-07-28 Thread Michele Simionato
nce). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple inheritance super()

2005-07-29 Thread Michele Simionato
ybe this is just wishful thinking ... Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Block-structured resource handling via decorators

2005-07-30 Thread Michele Simionato
, Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple inheritance super()

2005-07-30 Thread Michele Simionato
ard Python. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple inheritance super()

2005-07-30 Thread Michele Simionato
y on the childrens, dependending on their state. Perhaps I would need more information to understand what you have in mind. But at the end my point is "I would not feel much more constrained in expressivity if I did not have multiple inheritance in Python, and actually I have found out that th

doctest bug with nested triple quotes

2005-08-01 Thread Michele Simionato
e "", line 1 dummy = ''' ^ SyntaxError: EOF while scanning triple-quoted string ****** Is this a know bug? Any workaround? Thanks for comments, Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: doctest bug with nested triple quotes

2005-08-02 Thread Michele Simionato
sense, actually, but for some reason I would never have thought of it (I did not expect doctest to be so smart to strip the dots even inside a string). Thanks for the feeback and the quick solution, Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

issues with doctest and threads

2005-08-08 Thread Michele Simionato
#x27;, '.', '.', '.', '.'] """ import time, threading def example(): thread.out = [] while thread.running: time.sleep(.01) thread.out.append(".") thread = threading.Thread(None, example) if __name__ == "__main

Re: issues with doctest and threads

2005-08-09 Thread Michele Simionato
ly cannot understand the reason for such message. Why it is so misleading? Can something be done about it? TIA, Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: issues with doctest and threads

2005-08-10 Thread Michele Simionato
If you feel it's necessary to let threads spawned by a > doctest run beyond the time doctest completes, you can arrange to > invoke DocTestRunner.run() with clear_globs=False. Perfect, this answers my question and gives me an useful tip about doctest globals. Thanks a lot! Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: GUI tookit for science and education

2005-08-17 Thread Michele Simionato
1. Mateusz Loskot: >I would like to ask some scientists or students >which GUI toolkit they would recommend >to develop scientific prototypes (for education and >testing some theories). My vote is for ipython + matplotlib. Very easy and very powerful. Michele Simiona

Re: Decorator and Metaclasses Documentation

2005-08-21 Thread Michele Simionato
There are also my lectures at Oxford: http://www.reportlab.org/~andy/accu2005/pyuk2005_simionato_wondersofpython.zip Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Library and real path name

2005-08-23 Thread Michele Petrazzo
quot;site-packages/library/data/") it work, but I think that is not a good solution (a real pythonic solution). Can someone help me? Thanks Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: Library and real path name

2005-08-23 Thread Michele Petrazzo
Fredrik Lundh wrote: > Michele Petrazzo wrote: > >>I want to redistribute the library that I create. >>I create a project, its setup.py that when launched copy all files into >>the "site-packages/library" directory. And here it's all ok. >>Whe

Re: shelve non-transparency

2005-08-24 Thread Michele Simionato
ttr = 1 print s["x"].attr # => 1 s.close() Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Setting the encoding in pysqlite2

2005-08-25 Thread Michele Simionato
xample;") #print c.fetchall() c.close() if __name__ == "__main__": conn = sqlite.connect(DBFILE) writedb(conn) readdb(conn) conn.close() os.remove(DBFILE) I get UnicodeDecodeError: 'utf8' codec can't decode byte 0xec in position 3: une

Re: Externally-defined properties?

2005-08-25 Thread Michele Simionato
Well, I have used factories of properties external to the class many times, and they work pretty well. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Setting the encoding in pysqlite2

2005-08-26 Thread Michele Simionato
:-( Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

[ANN] FreeImagePy 1.0.0

2005-08-31 Thread Michele Petrazzo
NU GENERAL PUBLIC LICENSE - freeimagepy.sf.net/license-gpl.txt FIPL: FreeImage Public License - freeimagepy.sf.net/license-fi.tx More informations can be found here: http://freeimagepy.sf.net/ Michele Petrazzo -- http://mail.python.org/mailman/listinfo/python-list

Re: python logo

2005-09-03 Thread Michele Petrazzo
Xah Lee ha scritto: > i noticed that Python uses various logos: > Ok, this are not a logo, but better image are this: http://python.org/pics/PythonIndented_Back.jpg Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: Generators and Decorators doing my head in ..

2005-09-07 Thread Michele Simionato
ctionCalls def f(): pass f() f() f() help(f) The whole point of the decorator module is that the signature of the original function is left unchanged (i.e. in this case the decorated f is still a thunk, not a generic function f(*args, **kw)). HTH, Michele Simionato

issue with string.Template

2005-09-11 Thread Michele Simionato
lo",)) and T("$obj").substitute(obj="hello") give the same output (this potentially hides type bugs). So, take this as a bug report if the behavior is not intended and as a feature request if the current behaviour is the intended one ;) Michele Simionato P.S. at the end, the problem is that string interpolation with positional arguments is somewhat of a hack, but fixing this will have to wait until Python 3000 ... -- http://mail.python.org/mailman/listinfo/python-list

Re: global interpreter lock

2005-09-15 Thread Michele Simionato
;, "", "", "", "exit"]: print c.send(cmd) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrapper module for Linux shared lib

2005-09-16 Thread Michele Petrazzo
Ernesto wrote: > What's the best resource for finding out how to write a wrapper > module for a shared library file *.so* in Linux? > If you have only the .so file, not the source, you can use ctypes. I work always with it without problems. Michele -- http://mail.python.org/ma

distutils problem

2005-09-16 Thread Michele Petrazzo
eImagePy") setup( packages=['FreeImagePy', 'FreeImagePy.test', 'FreeImagePy.tools'], data_files=[ (prefix, dataToCopy),], ) How can I modify my script, for make it work with exe package? Thanks, Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible bug in "metaclass resolution order" ?

2005-09-17 Thread Michele Simionato
a bit lacking and you have to discover many things by trial and errors. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Possible bug in "metaclass resolution order" ?

2005-09-18 Thread Michele Simionato
uot;errors should never pass silently". May be. You are free to post the bug report and look at the opinions of the developers. I am happy enough with the current behavior and I would just update the docs. Michele Simionato Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

epydoc, variables and encoding

2005-09-21 Thread Michele Petrazzo
ss me what you want @type foo: A type @return: The object """ return foo This not work (MY_VAR is silently skipped), but if I remove: # -*- coding: utf-8 -*- it see MY_VAR and put it to my html file. Is it normal? Thanks, Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: python image library TIFF

2005-09-22 Thread Michele Petrazzo
bryan rasmussen wrote: > Hi > does anyone have any experience using the Python Image library to > determine if a Tiff is in the G4 or G3 codec? PIL don't support G3/G4 encoding. You can use freeimagepy that is another python graphic package. Michele (freeimagepy developer

Re: Definitive documentation on newstyle classes? (WAS: Pickling and inheritance are making me hurt)

2005-02-08 Thread Michele Simionato
w__" if you are interested). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Definitive documentation on newstyle classes? (WAS: Pickling and inheritance are making me hurt)

2005-02-09 Thread Michele Simionato
Colin: > It seems to me that __new__ should probably be deprecated for mutable > classes. Certainly not! It is useful for mutable classes too. One just must be careful. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

porting from Tkinter to pygtk

2005-02-09 Thread Michele Simionato
ivalent of the .after() method in pygtk? BTW, is there any intro to pygtk thought for Tkinter users? TIA, Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: implementing singleton class at the module level

2005-02-10 Thread Michele Simionato
A Singleton class is there to be inherited from; a singleton instance like the one you define is pretty much useless (unless I misunderstand your intentions). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: namespaces module (a.k.a. bunch, struct, generic object, etc.) PEP

2005-02-11 Thread Michele Simionato
t, as I > generally don't, it's close to usable.) FWIW, you can count me about the people who (re)wrote this same thing (actually with some difference, since I wanted to keep the order, so I used nested lists instead of nested dictionaries, but the idea was similar). I would welcome some module in the standard library to store hierarchical data. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems in making calulating program.

2005-02-15 Thread Michele Simionato
You were on the right track before: look at the tutor mailing list ;) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: adding new functionality to a function non-intrusively!

2005-02-16 Thread Michele Simionato
okbook for more examples. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: low-end persistence strategies?

2005-02-16 Thread Michele Simionato
What about bsddb? On most Unix systems it should be already installed and on Windows it comes with the ActiveState distribution of Python, so it should fullfill your requirements. -- http://mail.python.org/mailman/listinfo/python-list

Re: low-end persistence strategies?

2005-02-16 Thread Michele Simionato
The documentation hides this fact (I missed that) but actually python 2.3+ ships with the pybsddb module which has all the functionality you allude too. Check at the test directory for bsddb. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: low-end persistence strategies?

2005-02-16 Thread Michele Simionato
s with it. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: low-end persistence strategies?

2005-02-16 Thread Michele Simionato
What happens if for any reason the application crashes? Locked files will stay locked or not? And if yes, how do I unlock them? Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: low-end persistence strategies?

2005-02-17 Thread Michele Simionato
to implement it myself, but maybe I was wrong afterall ... Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: low-end persistence strategies?

2005-02-17 Thread Michele Simionato
ppens in the case of a power failure? Am I left with locked files floating around? Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: low-end persistence strategies?

2005-02-17 Thread Michele Simionato
Ok, I have yet another question: what is the difference between fcntl.lockf and fcntl.flock? The man page of my Linux system says that flock is implemented independently of fcntl, however it does not say if I should use it in preference over fcntl or not. Michele Simionato -- http

Re: low-end persistence strategies?

2005-02-18 Thread Michele Simionato
ons (remove the setgid bit) before trying to read or write to it. Of course, that might be a bit tricky if the system is hung :-( """ so lockf locks do not look completely harmless ... Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

recommended way of generating HTML from Python

2005-02-20 Thread Michele Simionato
standardization in this area. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: recommended way of generating HTML from Python

2005-02-20 Thread Michele Simionato
Just to clarify, before people start pointing out their preferred templating language: I am NOT asking for a template system. I am asking for something on the lines of HTMLGen, where you just use pure Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: questions concerning cgi.FieldStorage(keep_blank_values=1)

2005-02-20 Thread Michele Simionato
2&x=3&z=&y=4" print parse_qsl(QS) print parse_qsl(QS, keep_blank_values=True) which gives [('x', '1'), ('y', '2'), ('x', '3'), ('y', '4')] [('x', '1'), ('y', '2

Re: recommended way of generating HTML from Python

2005-02-20 Thread Michele Simionato
LTag() .tableheader = ["field1", "field2"] .tablebody = [["a1", "a2"], . ["b1", "b2"]] .html_header = [html.tr(html.th(el) for el in tableheader)] .html_table = [html.tr(html.td(el) for el in row) for row in tablebody] .print html.table(html_header + html_table) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: recommended way of generating HTML from Python

2005-02-21 Thread Michele Simionato
etween logic and presentation just putting the routines generating the HTML pages in a separate module, no need to use a different language. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: pydoc documentation

2005-02-22 Thread Michele Simionato
$ pydoc -g M.S. -- http://mail.python.org/mailman/listinfo/python-list

Re: pydoc documentation- referred to Michele answer

2005-02-22 Thread Michele Simionato
. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: web status display for long running program

2005-02-25 Thread Michele Simionato
) finally: # for instance, if CTRL-C is called counter.stop() And this is the CGI viewer: #!/usr/bin/python import os print "Content-type: text/plain\n" print "Counter: %s" % os.environ["COUNTER"] Pretty bare-bone ;) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Watermark on images

2005-02-26 Thread Michele Simionato
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362879 -- http://mail.python.org/mailman/listinfo/python-list

Re: Making a calendar

2005-02-26 Thread Michele Simionato
Looking at the "calendar" module in the standard library may help. Also, "pydoc calendar" is your friend. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Chinese curses, again (was Re: Why do descriptors (and thus properties) only work on attributes.)

2005-02-28 Thread Michele Simionato
origin ... Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: python-dev Summary for 2005-01-16 through 2005-01-31

2005-02-28 Thread Michele Simionato
it again so might as well move it out of >the way. +1 for this idea. The summary looks much better now :) Keep the good work going, Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

issues installing readine-1.12 on WinXP

2005-03-13 Thread Michele Simionato
ey_tex t_to_keyinfo return keyseq_to_keyinfo(keytext[1:-1]) File "C:\Python24\Lib\site-packages\readline\keysyms.py", line 163, in keyseq_ to_keyinfo res.append(char_to_keyinfo(keyseq[0], control, meta, shift)) File "C:\Python24\Lib\site-packages\readline\keysyms.py", line 111, in char_to _keyinfo raise ValueError, 'bad key' ValueError: bad key Any hints on what is causing this and the cure? TIA, Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: issues installing readine-1.12 on WinXP

2005-03-13 Thread Michele Simionato
That line seems right. The function is def char_to_keyinfo(char, control=False, meta=False, shift=False): vk = VkKeyScan(ord(char)) if vk & 0x == 0x: print 'VkKeyScan("%s") = %x' % (char, vk) raise ValueError, 'bad key' if vk & 0x100: shift = True if vk & 0x200: con

Re: issues installing readine-1.12 on WinXP

2005-03-13 Thread Michele Simionato
No, I don't even know how to get it under Windows (usually I use Linux). Switching to the US keyboard does not help, anyway. I get the same error. Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: issues installing readine-1.12 on WinXP

2005-03-13 Thread Michele Simionato
Well, this is ugly as the sin but it seems to work, at least for the moment: vk = VkKeyScan(ord(char)) if vk == -1: # ugly fix for backtips vk = 96 I will write to Gary Bishop to point out this issue with the Italian keyboard and see if he has some decent solution. Michele

Re: super with only one argument

2005-03-14 Thread Michele Simionato
I asked myself the same question and I am not convinced that using 'super' with one argument really makes sense (i.e. IMO it is more a liability than an asset). BTW, I have a set of notes on the tricky aspects of 'super' you may be interested in. Michele

Re: super with only one argument

2005-03-14 Thread Michele Simionato
super(D, D).f() D.f() Just using super(D).f() would not work. ``super`` with only one argument is a recipe for headaches. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: __getitem__ method on (meta)classes

2005-03-14 Thread Michele Simionato
define ``__getitem__`` directly, but only indirectly via delegation (i.e. overriding ``__getattribute__``), then the second form (i.e. ``type(x).__getitem__(x,y)``) works but not the first one (i.e. ``x[y]`` raises an error). Michele Simionato -- http://mail.python.org/m

iterable terminology (for language lawyers)

2005-03-16 Thread Michele Simionato
t the ACCU conference, so I want to make sure I use the rigth terminology. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: iterable terminology (for language lawyers)

2005-03-16 Thread Michele Simionato
ere already such links but I missed them). Would you agree with Leif's definition that iterable is any x such that iter(x) does not raise an error? On top of my head I don't find any counter example and it is the kind of definition I had in mind. Michele Simionato -- http

Re: Lisp-likeness

2005-03-16 Thread Michele Simionato
Or, just to impress Lispers, >>> def add(x,y): ... return x + y >>> closures = [] >>> for i in range(10): ...closures.append(add.__get__(i)) ... >>> closures[5](1000) 1005 Remember, in Python do not have functions, we have descriptors! ;)

Re: Lisp-likeness

2005-03-16 Thread Michele Simionato
ide the scope). So this idiom a = "" for i in range(10): if i == 5: a = "5 was reached" print a would not work. So, as I said, there are pros and contros. Personally, I like better the Scheme way (what I do not like in Scheme is the issue of inner defines vs. tople

Re: Lisp-likeness

2005-03-16 Thread Michele Simionato
> I'm surprised that Michele >hasn't yet referenced the thread where we exposed the gory details, as >was his custom for a while :-) >Message-ID: <[EMAIL PROTECTED]>, for >this particular >aspect, in case anyone gives a monkey's left testicle. I had for

Re: Lisp-likeness

2005-03-16 Thread michele . simionato
But then why he agreed to have the loop variable disappear outside a generator comprehension? I think there is something more than a backward compatibility concern. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: super with only one argument

2005-03-17 Thread Michele Simionato
s=super(B) ... >>> help(C) Traceback (most recent call last): ... ... lots of stuff here ... File "/usr/lib/python2.4/pydoc.py", line 1290, in docother chop = maxlen - len(line) TypeError: unsupported operand type(s) for -: 'type' and 'int' Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Interface support?

2005-03-17 Thread Michele Simionato
Twisted and Zope already use interfaces. You can download the interface package and use it in you project. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: metaclass error

2005-03-17 Thread Michele Simionato
F. Petitijean: > ManagerInterface is a module not a class ! Yes, but the error message could be improved (at least for the sake of people not knowing the internal working of Python). Do you care to fill a bug report? Michele Simionato -- http://mail.python.org/mailman/listi

Re: Interface support?

2005-03-17 Thread Michele Simionato
Now they use the same interface package. For the other questions: google is your friend. (try "zope interfaces" then "twisted interfaces"). -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-18 Thread Michele Simionato
. Just my 2 Eurocents, Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread Michele Simionato
ictionaries already have lots of methods and I would think twice before adding new ones; expecially methods that may turn out not that useful in the long range, or easily replaceble by user code. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread Michele Simionato
mind about a few new functions in an utility module. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: asynchat and threading

2004-11-29 Thread Michele Simionato
frameworks. Depending on your distribution, this may be already available. For instance in Mandrake 10.1 I just tried # urpmi python-twisted and it downloaded twisted 1.3. Seems to work too. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Curses programming, threads?

2004-12-03 Thread Michele Simionato
flush() write( '\x08' * len(msg) ) time.sleep( self.DELAY ) write( ' ' * len(msg) + '\x08' * len(msg) ) flush() def stop( self ): self.running = 0 self.join() if __name__=="__main__":

subprocess.Popen

2004-12-12 Thread Michele Simionato
it in the standard Popen class. I am surprised it is not there. Any comments? Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Namespaces and the timeit module

2004-12-13 Thread Michele Simionato
etup) try: print t.repeat(number=n) except: t.print_exc() You can import it with "from timeit_ import timeit" and it gives you access to your __main__ program namespace. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

collaborative editing

2004-12-10 Thread Michele Simionato
table of contents, indices, etc. Conversions to many formats (Latex, DocBook, etc.) would be welcome. Does something like that already exists? Alternatively, I would need some hierarchical Wiki with the ability of printing its contents in an structured way. Michele Simionato -- http

Re: odbc for solid

2004-12-24 Thread Michele Petrazzo
here: www.unipex.it/vario/RealPyOdbc.py In the future, when I'll finish it (make the db-api 2), I'll open a sf.net project. I hope it will help you. Bye, Michele Petrazzo -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows XP - cron or scheduler for Python?

2004-12-24 Thread Michele Petrazzo
or example, if the pc is lighted, but no logged-in, pycron don't work! Why don't add this function? I think that is simple to make with py2exe help. If you want I can create a simple GUI that can help the users that have no knowledge whit contrab sintax. Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: odbc script

2004-12-24 Thread Michele Petrazzo
. For now it is not db-api 2 compatible, but I use it in production and have no problems. You can try it here: www.unipex.it/vario/RealPyOdbc.py Of course, if you want to help me to make it db-api 2 compatible, you are welcome! Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-21 Thread Michele Simionato
self.setdefault(key, defaultfactory()) return defdict d = defaultdict(int)() d["x"] += 1 d["x"] += 1 d["y"] += 1 print d d = defaultdict(list)() d["x"].append(1) d["x"].append(2) d["y"].append(1) print d Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: How to use subprocess

2005-03-22 Thread Michele Simionato
I am not sure how safe it is, but on Linux I have just copied subprocess.py in my 2.3 installation and it worked in all the cases I tried. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Python for a 10-14 years old?

2005-03-24 Thread Michele Simionato
w I have forgot nearly everything ;) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: property and virtuality

2005-03-31 Thread Michele Simionato
I think you may find Alex Martelli's PyCon slides somewhere on the net. The black magic slides discuss this issue. But I think the fix he suggests is not dissimilar from what you are already doing. I don't remember exactly now, but it is always worth a look. Michele Simionato

Re: Stylistic question about inheritance

2005-03-31 Thread Michele Simionato
ass if there is a real need for it. Paraphrasing Occam, I would say "don't multiply base classes without necessity" ;) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: property and virtuality

2005-04-01 Thread Michele Simionato
d setters and making properties from them). I typically use a property factory function, or a custom descriptor. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Translation review?

2005-04-01 Thread Michele Simionato
This is spectacular! :) Is there a way to make it to work from environments (such as emacs) where stdin is special? Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: help with python-devel!!!

2005-04-03 Thread Michele Simionato
Just give (as root) # urpmi python-devel (assuming you have configured urpmi properly, Google for "easy urpmi"). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: "specialdict" module

2005-04-04 Thread Michele Simionato
Michael Spencer: > Alternatively, you could provide factory functions to construct the defaultdict. > Someone (Michele?) recently posted an implementation of this Yes, here is the link for the ones who missed that thread: http://groups-beta.google.com/group/comp.lang.python/browse_frm/

Re: "specialdict" module

2005-04-04 Thread Michele Simionato
defaultdict.__init__ you would just call dict.__init__ and not thirdpartdict. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: authentication in zope server & Python

2005-04-05 Thread Michele Simionato
Not to be rude, but you are on the wrong list and your question is ill formulated: http://www.catb.org/~esr/faqs/smart-questions.html http://www.zope.org/Resources/MailingLists Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: boring the reader to death (wasRe: Lambda: the Ultimate Design Flaw

2005-04-06 Thread Michele Simionato
ing with CLOS classes, which are pretty slim, since the (multi)methods are defined outside them? Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

decorating functions with generic signatures (not for the faint of heart)

2005-04-08 Thread Michele Simionato
I have realized today that defining decorators for functions with generic signatures is pretty non-trivial. Consider for instance this typical code: # def traced_function(f): def newf(*args, **kw): print "calling %s with args %s, %s" % (f.__name__, args, kw) return f(*args, *

Re: decorating functions with generic signatures (not for the faint of heart)

2005-04-08 Thread Michele Simionato
I said it was very little tested! ;) This should work better: # def _signature_gen(varnames, n_default_args, n_args, rm_defaults=False): n_non_default_args = n_args - n_default_args non_default_names = varnames[:n_non_default_args] default_names = varnames[n_non_default_args:n_args]

Re: decorating functions with generic signatures (not for the faint of heart)

2005-04-08 Thread Michele Simionato
Yes, this is essentially the same idea. You compile the codestring to bytecode, whereas I just evalue the codestring to a lambda function. We are essentially implementing a runtime macro by hand. I wonder if there is any alternative approach to get the same result, without manipulation of the sourc

Re: Multiple inheritance: Interface problem workaround, please comment this

2005-04-08 Thread Michele Simionato
: def __init__(self): print "C2.__init__" class D(C1, C2): def __init__(self): print "D.__init__" D() # you get # B.__init__ # C2.__init__ # C1.__init__ # D.__init__ Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   10   >