Re: Way for see if dict has a key

2006-06-30 Thread Michele Petrazzo
Fredrik Lundh wrote: > Michele Petrazzo wrote: > >>>> key in dict >>> new syntax (2.3 and later). >> So, following it, it can be used for the operations like len? > > what's "it" in this sentence? > It, is the thought that the new 2

Re: delete first line in a file

2006-06-30 Thread Michele Petrazzo
rg/doc/2.4.2/tut/node5.html#SECTION00514 and now you have only to wrote it http://python.org/doc/2.4.2/tut/node9.html#SECTION00920 Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: Way for see if dict has a key

2006-06-30 Thread Michele Petrazzo
André wrote: > Michele Petrazzo wrote: >> Bruno Desthuilliers wrote: >>>> but what the better >>> Depends on the context. >>> >> If know only one context: see if the key are into the dict... What other >> context do you know? >> >> Mi

string replace

2006-06-30 Thread Michele Petrazzo
add into the new 2.5 for startswith. I don't know, but can be this feature included into a future python release? Thanks, Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: python for windows internet filter / firewall

2006-06-30 Thread Michele Petrazzo
you _can't_ with python. How you create a .sys/.vxd file? Also that has only few kb program? And don't such more than few kb memory? Keep the proxy way or switch to another language :) > Thanks again. --matthew > Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: string replace

2006-07-01 Thread Michele Petrazzo
[EMAIL PROTECTED] wrote: > Check out the .translate method and the string.maketrans documentation. > You can use it to delete a list of characters all in one line: > Yes. This is, more or less, what I were looking for. P.s. Sure, if replace could accept a tuple... :) Thanks to all

Re: a new object definition

2006-09-01 Thread Michele Simionato
peps/pep-0359 (already rejected by Guido). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: a new object definition

2006-09-01 Thread Michele Simionato
Sylvain Ferriol wrote: > Michele Simionato a écrit : > > > > See http://www.python.org/dev/peps/pep-0359 (already rejected by > > Guido). > > > i do not understand the withdrawal note, what do "different level" mean ? > do you have an example or is it py

Re: What are super()'s semantics?

2006-09-04 Thread Michele Simionato
world. Anyway, the MRO concept is documented here: http://www.python.org/download/releases/2.3/mro/ (yes, it is not easy to find this link in python.org). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Javadoc style python manual?

2006-09-08 Thread Michele Simionato
Ben Sizer wrote: > I agree that the Python docs aren't quite as effective as reference > material due to the lack of simple function and method lists though. http://docs.python.org/lib/modindex.html, pydoc and ipython are more than enough for me. Michele Simionat

Re: Javadoc style python manual?

2006-09-08 Thread Michele Simionato
Ben Sizer wrote: > Michele Simionato wrote: > > Ben Sizer wrote: > > > I agree that the Python docs aren't quite as effective as reference > > > material due to the lack of simple function and method lists though. > > > > http://docs.python.org/l

Re: super and __init__

2006-09-11 Thread Michele Simionato
Noah wrote: > Am I the only one that finds the super function to be confusing? No, see for instance http://fuhm.net/super-harmful/ Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL cannot open TIFF image in Windows

2006-09-11 Thread Michele Petrazzo
with lower-rgb-planar- > 8 and flower-rgb-contig- > 8 IrfanView seem that can load all the images... > Rob. Bye, Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: descriptor problems

2006-09-14 Thread Michele Simionato
;__set__' You need to define the descriptor at the metaclass level too. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I get the function's caller?

2006-09-14 Thread Michele Simionato
ot defined yet" > > regards > David Check also the warnings module (it will give you also line number information for free). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Request for elucidation: enhanced generators

2006-09-20 Thread Michele Simionato
by the user in HTML hidden widgets. Sometimes the simplest solutions are the better ones ;) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: CONSTRUCT - Adding Functionality to the Overall System

2006-09-20 Thread Michele Simionato
(I don't believe I am responding to a notorious troll ...) One (bad) solution is to write in your sitecustomize.py the following: $ echo /usr/lib/python/sitecustomize.py import __builtin__ class Object(object): def debug(self): print 'some debug info' __builtin__.object = Object th

Re: Request for elucidation: enhanced generators

2006-09-21 Thread Michele Simionato
am not claiming that this is a good idea. Michele Simionato --- import datetime import cherrypy as cp # each user (but really should be each session) has her input loop # one should disable the back button and implement an undo mechanism def inputloop(user): start_time = datetime.datetime.to

Re: Decorator cllass hides docstring from doctest?

2006-09-21 Thread Michele Simionato
t the mistake. I wrote a module to avoid this kind of issues, so you may want to check it out: http://www.phyast.pitt.edu/~micheles/python/documentation.html Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: how to remember login in zope?

2006-09-25 Thread Michele Simionato
cmf or plone , how could i handle this? > thanks a lot. > > i'm working around this for two days and surfing a lot of pages but > still felt confused, any suggestion would be appreciated. This is the wrong list. See http://www.zope.org/Resources/MailingLists Michele Simio

Re: a different question: can you earn a living with *just* python?

2006-09-27 Thread Michele Simionato
now Python you can earn your living. Heck, there are people knowing Visual Basic only that earn their living! ;) Anyway, at work I use Python and SQL only (and a bit of bash and HTML). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: a different question: can you earn a living with *just* python?

2006-09-27 Thread Michele Simionato
Python only. Notice that by "knowing Python" I mean also knowing its standard library and the most common Python third party libraries (GUI toolkits, XML toolkits, SQL libraries, twisted, etc. etc.) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Decoding group4 tiff with PIL

2006-09-27 Thread Michele Petrazzo
/2004/pytiff/ > > Any thoughts? > [1] Seem to work. You need "only" some dlls (http://gnuwin32.sourceforge.net/packages/tiff.htm) [3] FreeImagePy > Cheers, Filipe > Bye, MIchele -- http://mail.python.org/mailman/listinfo/python-list

Re: a different question: can you earn a living with *just* python?

2006-09-28 Thread Michele Simionato
mmers don't. Yep, I think that's the point. Worth repeating (and +1 for QOTW). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: a different question: can you earn a living with *just* python?

2006-09-28 Thread Michele Simionato
Ruby it is not really different from Python in terms of learning "new ways of programming". Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: a different question: can you earn a living with *just* python?

2006-09-28 Thread Michele Simionato
this stuff, you are likely to be able to learn any language. My point was that when hiring a programmer, one should also look at the potential of the person, not only at his/her present skills. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Execute external code and get return value

2006-09-29 Thread Michele Petrazzo
xec") #do something like this return_value = comp_code.funct2Call() But I can't... I find this: http://tinyurl.com/nwbpk but here, it call from the external code a function inside my code. I want the opposite! Is there a solution for do this? Thanks, Michele -- http://mail

Re: Execute external code and get return value

2006-09-29 Thread Michele Petrazzo
Michele Petrazzo wrote: Auto reply: > I find this: http://tinyurl.com/nwbpk > Following this link, here is my solution: code = """ def funct2Call(): return "It work!" object.method(funct2Call) """ class Object(object): def method

Re: Execute external code and get return value

2006-09-29 Thread Michele Petrazzo
Peter Otten wrote: > Michele Petrazzo wrote: > >> I want to execute an external code, that become from a text file >> (pe), call a function inside it and get its return value: > > namespace = {} execfile("ext_code.txt", namespace) print > namespace["func

Re: postgresql database

2006-10-02 Thread Michele Simionato
t; > import psycopg > ImportError: No module named psycopg > > come mai? va settata qualche path oltre a quella di postgresql ? > > grazie dell'aiuto Well, if you are using Psycopg2, do import psycopg2 (and please use the italian mailing list for questions in Italian).

Re: string: __iter__()?

2006-10-04 Thread Michele Simionato
sequence of characters) and I can check hasattr(obj, '__iter__') to distinguish (for instance) a list of strings from a single string (typically in recursive algorithms working on texts). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a reason not to do this?

2006-12-01 Thread Michele Simionato
e, func) return func return decorator @defmethod(C) def m1(self, x):pass help(m1) BTW, for people with a Lisp background I recommend using IPython with emacs and the ipython.el mode. It is pretty good, even if not comparable to Slime. Michele Simio

Re: Functions, callable objects, and bound/unbound methods

2006-12-01 Thread Michele Simionato
nctions and Methods" in > http://users.rcn.com/python/download/Descriptor.htm > > You need to implement a __get__ method on your class. See also http://groups.google.com/group/comp.lang.python/browse_frm/thread/d691240a5cfebcdf/93503c5b9c66226e?lnk=gst&q=simionato+subclassing+Fu

Re: Is there a reason not to do this?

2006-12-02 Thread Michele Simionato
not obj.__class__: obj.__class__ = cls class C(object): # old class def m1(self): return 1 c = C() # old instance assert c.m1() == 1 class C(object): # new class def m1(self): return 2 update(c) # old instance updated assert c.m1() == 2

Re: Is there a reason not to do this?

2006-12-02 Thread Michele Simionato
27;Q' assert c.m1() == 'Q' assert c.__class__.__module__ == __name__ # make sure c.__class__ is defined in the current module Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: About the 79 character line recommendation

2006-12-06 Thread Michele Simionato
t against extra-large one-liners. Finally, notice that you can alwasys aliases if you are a lazy typist: shortcut = LongClassName.LongAttributeName This also saves an attribute access and gives you some additional speed, which may be useful in some cases. Michele Simionato -- http://mail.p

Re: What are python closures realy like?

2006-12-06 Thread Michele Simionato
u want persistency (you cannot pickle a closure) so in that case I use a callable object instead. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-11 Thread Michele Simionato
Timofei Shatrov wrote: > It's not surprising that no one uses this stuff for serious work. Well, I replaced all my unittests with doctests long ago, and I am not the only one following this way (see the Zope 3 project for instance). Michele Simionato -- http://mail.python.org

Re: merits of Lisp vs Python

2006-12-11 Thread Michele Simionato
Paul Rubin wrote: > "Alex Mizrahi" <[EMAIL PROTECTED]> writes: > > > "Programming Languages:Application and Interpretation" > > Shriram Krishnamurthi > > Brown University > This book doesn't seem to be online. http://cs.brown.edu/~sk/Publ

Re: alternate language

2006-12-11 Thread Michele Simionato
doesn't take 60 hour weeks over years to master > Chicken Scheme: http://www.call-with-current-continuation.org (not sure about wx, but there are various GUI wrappers available) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Defining classes

2006-12-14 Thread Michele Simionato
Nick Maclaren wrote: > It would be much cleaner not to have to fiddle with static > members after the class is initialised. You can hide the fiddling, for instance with the trick explained here: http://www.phyast.pitt.edu/~micheles/python/classinitializer.html Michele Simionato --

Re: Multiple inheritance and __slots__

2006-12-14 Thread Michele Simionato
e even if one does not care about > memory. See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252158 (how to freeze Python classes) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Defining classes

2006-12-15 Thread Michele Simionato
ay that you are using the metaclass hook here, but not a "real" metaclass. Still waiting for class decorators ... Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Metaclass uses?

2006-12-18 Thread Michele Simionato
http://www.phyast.pitt.edu/~micheles/python/classinitializer.html Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

How a script can know if it has been called with the -i command line option?

2006-12-21 Thread Michele Simionato
The subject says it all, I would like a script to act differently when called as $ python script.py and when called as $ python -i script.py. I looked at the sys module but I don't see a way to retrieve the command line flags, where should I look? TIA, Michele Simionato --

Re: How a script can know if it has been called with the -i command lineoption?

2006-12-21 Thread Michele Simionato
Hendrik van Rooyen wrote: > "Michele Simionato" <[EMAIL PROTECTED]> wrote: > > > > The subject says it all, I would like a script to act differently when > > called as > > $ python script.py and when called as $ python -i script.py. I looked > &g

optparser question

2006-12-22 Thread Michele Petrazzo
ecify the type in add_options, the value aren't passed to the store_value (into value variable), but it's understood as args! If I specify it, it Is this normal? Thanks, Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: optparser question

2006-12-22 Thread Michele Petrazzo
ovide a callback to a new action. I believe, however, that the doc has to be more explicit about this strange behavior, because a not so expert dev (like me :) ), can don't understand at the first time, it. > STeVe Thanks, Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: program deployment

2007-01-05 Thread Michele Simionato
the code written by others. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: wxWindows off-screen?

2007-01-05 Thread Michele Petrazzo
Ivan Voras wrote: > Is it possible to draw a widget or a window in an off-screen buffer? (Assuming that you are on linux.) wxWigets (wxWindows is the old name) or better, since if you are on a python ng, wxPython :), can't be used if you are on a not-X machine: michele:~$ env | grep DIS

Re: General Question About Python

2007-01-09 Thread Michele Simionato
think of something to get yourself visibile (i.e. contribute to some OSS project, write articles, partecipate to conferences, etc.) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: The problem of anonymity with decorators

2006-02-07 Thread Michele Simionato
or, "should return int" TypeError: should return int The reason of is that the module internally uses 'exec'. There should be a way around that, anyway, but I have no time to check it right now. Still, the module may be of inspiration to you. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: super(...).__init__() vs Base.__init__(self)

2006-02-09 Thread Michele Simionato
I remember there was somewhere a page called "super considered harmful", some googling should find it. It was discussing the issue you are alluding to, as well others. Also google in the newsgroup, there are lots of threads about super and its shortcomings. Michele Simionato

Re: using the Filters DLL (image filters)

2006-02-15 Thread Michele Petrazzo
so). You can see them for study and copy that code (like all do :P ). Start at wnd.sf.net and freeimagepy.sf.net > > Kind regards, Dieter > Bye, Michele -- http://mail.python.org/mailman/listinfo/python-list

ANN: FreeImagePy 1.2.2

2006-02-16 Thread Michele Petrazzo
anges from 1.2.0: New convertToPil function: i = FreeImagePy.Image("myImage.ext") pil = i.convetToPil() Some bugs solved Michele Petrazzo -- http://mail.python.org/mailman/listinfo/python-list

Re: Visual Report Editor

2006-02-16 Thread Michele Petrazzo
l send you the code, so after we'll a new -open source (do you like wxWidgets license? [LGPL] )- *Visual Reporting Editior* > > Pawel > Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: FreeImagePy 1.2.2

2006-02-16 Thread Michele Petrazzo
it into my python fax client [hylapex] that it's connect to hylafax server. Of course, It wouldn't be a PIl replacement ;)! > Claudio Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs. Lisp -- please explain

2006-02-20 Thread Michele Simionato
production, > maintenance and reuse costs of python code considerably, so much in fact that > python's very slowness represents part of its competetive edge over languages > that are in some ways better engineered and more capable. I think you have a very good point here. +1000! Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

streaming Popen.stdout

2006-02-21 Thread Michele Simionato
e every seconds. How can I get that in a simple way? A Unix-only solution would be fine, too. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Zope/Plone - Is it the right solution?

2006-02-21 Thread Michele Simionato
hat is happening. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Zope/Plone - Is it the right solution?

2006-02-21 Thread Michele Simionato
of use nothing beats CherryPy, but I am not sure how stable it is. Quixote is nice and small, and pretty easy to use too. Many likes Django and TurboGears. Zope and Twisted are for people who have a lot of time to invest. Michele Simionato -- http://mail.python.org/mailman/listinfo/python

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Michele Simionato
first point on interactive sessions, are you aware of Michael Hudson's recipe "automatically upgrade class instances on reload()" http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/160164 ? Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: PyUNO with different Python

2006-02-22 Thread Michele Petrazzo
stem python outside OOo? For the first, follow this: http://udk.openoffice.org/python/python-bridge.html#replacing for the second: http://udk.openoffice.org/python/python-bridge.html#modes > Any hints? Regards, Katja Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: streaming Popen.stdout

2006-02-23 Thread Michele Simionato
Replying to myself ... I cooked up this solution involving os.pipe and os.fork, but I am not especially happy with it; anyway, let me write it. Feedback is welcome, since this was written very quickly and I may have missed something. BTW, are there libraries out there doing something similar? ---

Re: PyUNO with different Python

2006-02-23 Thread Michele Petrazzo
th, the program at: http://udk.openoffice.org/python/samples/ooextract.py work well with a modify: before the first line "import uno", add: import sys sys.path.append("/opt/openoffice.org2.0/program/") Now, save the program, move it where you want, and go: michele:~$ python2.

Re: PyUNO with different Python

2006-02-23 Thread Michele Petrazzo
ce... > Regards, Katja Michele -- http://mail.python.org/mailman/listinfo/python-list

Exception not raised

2006-02-24 Thread Michele Petrazzo
print dont_exist NameError: global name 'dont_exist' is not defined So all the exception are raised except the KeyError outside the try/except! I don't know what can be. Thanks to all that can help me. Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception not raised

2006-02-24 Thread Michele Petrazzo
#here I don't see the exeception >Maybe you don't use dict, but a subclass of it? All my dict are created as d = dict() and populate by: d.update(other_dict) or for k, val in iter: d[k] = val > > Diez Thanks, Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception not raised

2006-02-24 Thread Michele Petrazzo
Michele Petrazzo wrote: > Hi list, I have a strange error on my software on win 2k/xp and > debian 3.1 with py 2.3.5 / 2.4.1 + twisted + wxpython: Just for give evidence to my _failed_ tests, my a debugger (eric3), it see the exception, so it break with a KeyError! And the same code, no!

Re: Exception not raised

2006-02-24 Thread Michele Petrazzo
Michele Petrazzo wrote: > Michele Petrazzo wrote: >> Hi list, I have a strange error on my software on win 2k/xp and >> debian 3.1 with py 2.3.5 / 2.4.1 + twisted + wxpython: > Opss, I forgot some words :) > Just for give evidence to my _failed_ tests, my a debugger (eric3)

Re: Exception not raised

2006-02-25 Thread Michele Petrazzo
ill be able to help you. Into my 100 line code, that exception (and all the others) are raised! I don't able, into all my tries, to reproduce that error on a small code... I can publish my code, if someone has one hour of spare time and a postgresql where test the code. I'

Re: Write a GUI for a python script?

2006-03-02 Thread Michele Simionato
Tkinter is the GUI toolkit that comes with Python and is available on all platform without any installation effort. It is quite OK for simple things and I would recommend it for any beginner. Google for "An Introduction to Tkinter" by F. Lund. Michele Simionato -- http://mail.

Exception not raised - May be the end

2006-03-02 Thread Michele Petrazzo
ings[_prefixMB + menu_string]) Hope that someone can reproduce this error. I see it on win2k (terminal usage) and debian (terminal and eric3 )... py 2.3.5 and wx 2.6 Thanks a lot, Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple System Tray Icon

2006-03-02 Thread Michele Petrazzo
.. :) > Can someone point me to a simple example that just shows an icon? I > don't need it to anything but show up. Any help is appreciated. Copy and paste that lines into your code and remove the lines that you don't need. I think that with 15/20 lines you will your taskbar wor

Re: Exception not raised - May be the end

2006-03-03 Thread Michele Petrazzo
Sion Arrowsmith wrote: > Michele Petrazzo <[EMAIL PROTECTED]> wrote: >> some days ago I posted here and say that python "forgot" to raise >> an exception, but my code was too long for make some tries >> possible. But now I can reproduce the pro

Re: Reusing object methods?

2005-05-01 Thread Michele Simionato
about the resolution order etc.) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: MRO problems with diamond inheritance?

2005-05-01 Thread Michele Simionato
> M.E.Farmer: >Your answer lies somewhere in this page ;) >http://www.python.org/2.2.2/de­scrintro.html Yes, when it refers to http://www.python.org/2.3/mro.html (section Bad Method Resolution Orders). In short, it is a feature, not a bug. Michele Simionato

Re: MRO problems with diamond inheritance?

2005-05-02 Thread Michele Simionato
e class. So you can override it without problems, and still access it as type.mro(cls). For more about metamethods see http://www-128.ibm.com/developerworks/linux/library/l-pymeta2/index.html Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: MRO problems with diamond inheritance?

2005-05-02 Thread Michele Simionato
'purpose' of classmethods. In my personal opinion classmethods and staticmethods could (and possibly should) be removed from the language; a part for that consideration, the typical use for classmethods is as object factories, to provide alternative constructors. Miche

Re: MRO problems with diamond inheritance?

2005-05-02 Thread Michele Simionato
BTW, what it your use case? I have yet to see a single compelling use case for multiple inheritance, so I am curious of what your design is. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: MRO problems with diamond inheritance?

2005-05-02 Thread Michele Simionato
s, annoyances. Whereas I recommend the first lecture about iterators and generators to everybody, take in account than the second and especially the third lecture may cause your head to explode. I do not take any responsability in that case. """ Michele

WordPress Python Library 1.0

2005-05-02 Thread Michele Ferretti
http://www.blackbirdblog.it/programmazione/progetti/28 -- Michele Ferretti ICQ#: 14491159 Skype: m.ferretti79 black DOT bird AT tiscali DOT it www.blackbirdblog.it -- http://mail.python.org/mailman/listinfo/python-list

Re: WordPress Python Library 1.0

2005-05-02 Thread Michele Ferretti
François Pinard wrote: > [Michele Ferretti] > >>http://www.blackbirdblog.it/programmazione/progetti/28 > > > Quoted above, the full content of your article. Is it a message? It > surely does not look like an English sentence. > > Should we start a browser each t

Re: empty lists vs empty generators

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

Re: Use case for multiple inheritance (was Re: MRO problems with diamond inheritance?)

2005-05-02 Thread Michele Simionato
ad and written MI hierarchies that could have much better written without MI. Finally, let me say that cooperative methods are terrible for maintenance. Nowadays, I tend to use MI just for debugging (yes, a mixing is convenient, if not compelling, for adding debugging functionality to a class). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: WordPress Python Library 1.0

2005-05-02 Thread Michele Ferretti
Cappy2112 wrote: > If you wan't explain what WordPress is, can you at least supply a link > for a page that's in English? > WordPress is most diffused blog engine: http://www.wordpress.org My library is a client for connect to WP installation. -- Michele Ferretti I

Re: WordPress Python Library 1.0

2005-05-02 Thread Michele Ferretti
Excused all, I have mistaken! I did not know these rules the next time I will follow them Terry Reedy wrote: > "Michele Ferretti" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > François Pinard wrote: > >>[Michele Ferretti] >> >>

Re: Documenting Python code.

2005-05-03 Thread Michele Simionato
I would say reStructuredText is the preferred format for documenting Python code. Google is your friend. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: empty lists vs empty generators

2005-05-03 Thread Michele Simionato
opy of the original one >>> it1.next() 1 In general you can use the idiom it = check(it) # check for emptiness if it: # do something This time I have checked the examples here with my doctester http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/410052 ;) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: WordPress Python Library 1.0

2005-05-04 Thread Michele Ferretti
[EMAIL PROTECTED] wrote: > Caro Michele: > > Non parlo italiano, ma parlo espagnol. I can read your website, and > your library looks interesting. Would you like me to provide an > english translation of your webpage so that you can provide a version > for english spe

Re: Adding new methods to new-style classes dynamically

2005-05-05 Thread Michele Simionato
Do you mean setattr? setattr(A, meth_name, lambda self: type(self)) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: A Module on Time & Date

2005-05-10 Thread Michele Simionato
You should read the documentation and this: http://www.catb.org/~esr/faqs/smart-questions.html Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: object oriented inheritance problem

2005-05-10 Thread Michele Simionato
-style classes and more). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

decorator module

2005-05-16 Thread Michele Simionato
find it here: http://www.phyast.pitt.edu/~micheles/python/decorator.zip It is released under the Python licence. Let me know if you are using it and if you would like further additions/improvements/changes/etc. Feeback is welcome! Michele Simionato -- http://mail.python.org

Re: Quick Reference from module doc strings.

2005-05-17 Thread Michele Simionato
nks to the original source code, so I can see it with a click. I can feed to "minidoc" whole packages (it works recursively on subpackages, so everything is documented). It was unvaluable in my struggle with Zope. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Quick Reference from module doc strings.

2005-05-17 Thread Michele Simionato
an reach the documentation for that name with a click. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Quick Reference from module doc strings.

2005-05-17 Thread Michele Simionato
on >Ps... I like your physics link page. :) That page is old, I am no more in physics, but I still have that account for free and I am lazy, so I am keeping it ;) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Quick Reference from module doc strings.

2005-05-17 Thread Michele Simionato
These days I use generators instead of StringIO, i.e. instead of print >> out, mystring I just write yield mystring and then I "".join the generator. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: super() and automatic method combination

2005-05-18 Thread Michele Simionato
b.org/~andy/accu2005/pyuk2005_simionato_wondersofpython.zip You can also define a custom super that does not give an error when the superclass doesn't have the corresponding method (I posted an example some time ago to somebody complaining for the same reason). Michele Sim

self-promotion of the decorator module (Was: How to learn OO of python?)

2005-05-18 Thread Michele Simionato
are preserved; 3. the signature of the original function is preserved (this one is nontrivial). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

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