Re: Style question: metaclass self vs cls?

2012-07-17 Thread Michele Simionato
The standard is to use `cls`. In the __new__ method you can use `mcl` or `meta`. -- http://mail.python.org/mailman/listinfo/python-list

surprising behaviour of global dictionaries

2012-10-09 Thread Michele Simionato
I have the following module implementing a registry of functions with a decorator: $ cat x.py registry = {} # global dictionary def dec(func): registry[func.__name__] = func print registry, id(registry) return func if __name__ == '__main__': import xlib print registry, id(re

Re: surprising behaviour of global dictionaries

2012-10-09 Thread Michele Simionato
On Tuesday, October 9, 2012 5:24:17 PM UTC+2, Peter Otten wrote: > Seriously, you shouldn't use the main script as a library; it is put into > > the sys.modules cache under the "__main__" key. Subsequent imports under its > > real name will not find that name in the cache and import another ins

Testing against multiple versions of Python

2012-10-18 Thread Michele Simionato
dvice is welcome! Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Testing against multiple versions of Python

2012-10-19 Thread Michele Simionato
ShiningPanda looks really really cool. I need to investigate it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Instrumenting a class to see how it is used

2012-05-14 Thread Michele Simionato
This may get you started (warning: not really tested). $ echo instr.py from warnings import warn oget = object.__getattribute__ tget = type.__getattribute__ class Instr(object): class __metaclass__(type): def __getattribute__(cls, name): clsname = tget(cls, '__na

A better contextlib.contextmanager

2012-05-23 Thread Michele Simionato
Python 3.2 enhanced contextlib.contextmanager so that it is possible to use a context manager as a decorator. For instance, given the contextmanager factory below @contextmanager def before_after(): print(before) yield print(after) it is possibile to use it to generate decorators: @b

Re: Argparse, and linking to methods in Subclasses

2011-07-18 Thread Michele Simionato
Here is an example by using my own library plac (http://pypi.python.org/pypi/plac): class Server(): def configure_logging(self, logging_file): pass def check(self): pass def deploy(self): pass def configure(self): pass def __init__(self, hostnam

Re: Python's super() considered super!

2011-05-27 Thread Michele Simionato
On Friday, May 27, 2011 10:49:52 AM UTC+2, Ben Finney wrote: > The exquisite care that you describe programmers needing to maintain is IMO > just as much a deterrent as the super-is-harmful essay. Worth quoting. Also I think this article may encourage naive programmers along the dark path of coop

Re: Python's super() considered super!

2011-05-27 Thread Michele Simionato
The fact that even experienced programmers fail to see that super(type(self),self) in Python 2 is NOT equivalent to super() in Python 3 is telling something. -- http://mail.python.org/mailman/listinfo/python-list

Re: Class decorators might also be super too

2011-05-28 Thread Michele Simionato
He is basically showing that using mixins for implementing logging is not such a good idea, i.e. you can get the same effect in a better way by making use of other Python features. I argued the same thing many times in the past. I even wrote a module once (strait) to reimplement 99% of multiple

Re: multiprocessing shows no benefit

2017-10-20 Thread Michele Simionato
There is a trick that I use when data transfer is the performance killer. Just save your big array first (for instance on and .hdf5 file) and send to the workers the indices to retrieve the portion of the array you are interested in instead of the actual subarray. Anyway there are cases where m

Re: Let's talk about debuggers!

2017-10-25 Thread Michele Simionato
pdb plus plus: https://pypi.python.org/pypi/pdbpp -- https://mail.python.org/mailman/listinfo/python-list

Re: Recommendation for Object-Oriented systems to study

2016-05-29 Thread Michele Simionato
On Sunday, May 29, 2016 at 4:42:17 PM UTC+2, Ankush Thakur wrote: > Hello, > > I'm a self-taught programmer who has managed to claw his way out of Python > basics and even covered the intermediate parts. But I feel I have a ton of > theory in my head and would like to see some smallish applicati

Re: argparse and subparsers

2016-06-28 Thread Michele Simionato
I did not know about docopt. It is basically the same idea of this recipe I wrote about 12 years ago: https://code.activestate.com/recipes/278844-parsing-the-command-line/?in=user-1122360 Good that it was reinvented :-) -- https://mail.python.org/mailman/listinfo/python-list

Re: Metaclasses, decorators, and synchronization

2005-09-26 Thread Michele Simionato
n poking around in new and inspect, but it is not > appearing like an easy task. It is not that easy, but you can leverage on my decorator module which does exactly what you want: http://www.phyast.pitt.edu/~micheles/python/decorator.zip Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 308 accepted - new conditional expressions

2005-09-30 Thread Michele Simionato
nk Terry's recollection is pretty close to the "historical truth". Guido could have decided two years ago, sparing us the PEP 308 ordalia. So, I am happy that at the end we will have a conditional operator, but I am not happy of how the process worked out. It was just an enormous

how to send a SIGINT to a Python process?

2005-09-30 Thread Michele Simionato
Is there a way to send a SIGINT/KeyboardInterrupt to a Python process (knowing the pid) that works both on Unix and Windows? Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Feature Proposal: Sequence .join method

2005-09-30 Thread Michele Simionato
rs StopIteration is automatically trapped, i.e. def g(): yield 1 raise StopIteration yield "Never reached" only yields 1. Not sure if this is documented behavior, however, of if it is an implementation accident. Anybody who knows? Michele Simionato -- htt

Re: Python recipes: list mixin, improved timeit, etc

2005-10-07 Thread Michele Simionato
asily abused (see Zope 2) and as a consequence you get spaghetti-inheritance, where you have objects with methods inherited from everywhere. So be very careful if you want to use mixins; often you can go without them. Just my 2 Euro cents, Michele Simionato -- http://mail.python.org/ma

Re: Python recipes: list mixin, improved timeit, etc

2005-10-07 Thread Michele Simionato
ll am not sure > if I gained anything or not. Nowadays I tend to use delegation via __getattr__ instead of multiple inheritance. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't extend function type

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

users of pycurl here?

2005-10-07 Thread Michele Simionato
I am having a hard time in finding out how to retrieve information about the *size* of files I want to download from an FTP site. Should I send a QUOTE SIZE command to the ftp server or is there an easier way? TIA, Michele Simionato -- http://mail.python.org/mailman/listinfo

Re: users of pycurl here?

2005-10-10 Thread Michele Simionato
usage example, see the sanity.py test script" but there is not such a script in the distribution :-( Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: users of pycurl here?

2005-10-10 Thread Michele Simionato
Yes, it works fine, thanks (still I am a bit surprised there is not ftpparse.py but only an _ftpparse.so). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Batteries Included?

2005-10-11 Thread Michele Simionato
formats, it tells me the wininst format > is a windows installer. I can confirm that it works (for pure Python applications), since I did it. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Well written open source Python apps

2005-10-14 Thread Michele Simionato
> Could anyone suggest an open source project that has particularly well > written Python? I am especially looking for code that people would > describe as "very Python-ic". I vote for the "doctest" code in the standard library. Michele Simionato -- h

example of using urllib2 with https urls

2005-10-18 Thread Michele Simionato
Can somebody provide an example of how to retrieve a https url, given username and password? I don't find it in the standard documentation. TIA, Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs Ruby

2005-10-21 Thread Michele Simionato
Tom Anderson: >> I have no idea what Scheme is, but I'll cettainly look it up as soon as >> I'm done writing this. > You won't like it. Give yourself another 5-10 years, and you might start > to find it strangely intriguing. +1 ;-) Michele Simionato -

Re: Python vs Ruby

2005-10-24 Thread Michele Simionato
ted the lower level of abstraction). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Python vs Ruby

2005-10-24 Thread Michele Simionato
Alex Martelli: > Michele Simionato: >> cutting off non-essential features (and you can discover that a feature >> is non essential only after having implemented it) > This one is difficult if you have RELEASED the program with the feature > you now want to remove, sigh.

Re: tool for syntax coloring in html

2005-10-26 Thread Michele Simionato
Gerhard wrote: > http://initd.org/pub/software/pysqlite/doc/usage-guide.html Can I suggest you to use a larger font for the code?It is pretty difficult to parse with my current screen resolution. BTW, pysqlite2 is pretty cool ;) Michele Simionato -- http://mail.python.

Re: Web automation with twill

2005-11-04 Thread Michele Simionato
BTW, O'Reilly just published an article of mines on twill: http://www.onlamp.com/pub/a/python/2005/11/03/twill.html Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Web automation with twill

2005-11-04 Thread Michele Simionato
qwwwee: > By the way, are you aware that C. Titus Brown (twill's author) > tells "peste e corna" of Zope? No, but I am not surprised. I also say "peste e corna" of Zope ;) In general I am an anti-frameworks guy (in good company with many Pythonistas including Guido

Re: which feature of python do you like most?

2005-11-08 Thread Michele Simionato
> which feature of python do you like most? It makes easy things easy, while keeping hard things possible. -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing Tkinter on knoppix

2005-11-09 Thread Michele Simionato
sudo apt-get install python2.4-tk -- http://mail.python.org/mailman/listinfo/python-list

Re: web interface

2005-11-10 Thread Michele Simionato
Javascript. So, I don't think there is a real solution for this kind of problem as of today (I would love to be wrong, though). Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Tutorials for Python + PostgreSQL

2005-11-23 Thread Michele Simionato
with PostgreSQL for 2 > years, and with Python for 6 months. > Thank you, Since Psyco is meant to speedup Python code, whereas the psycopg adapter is C-coded, I strongly doubt you will get any improvement from the combination. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: super() and multiple inheritance

2005-12-02 Thread Michele Simionato
insically HARD to support. If you can avoid it, avoid it. This will probably make your application more maintanable. I your case, I would go with the keyword argument suggestion. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Favorite flavor of Linux? (for python or anything else)

2005-12-05 Thread Michele Simionato
I tried Kubuntu and Debian (in the trivial to install version known as Knoppix/Kanotix) and I like Debian more, but this is just me. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Rebinding stdout (was: Re: Python! Is! Truly! Amazing!)

2005-01-03 Thread michele . simionato
Just wrote: > In article <[EMAIL PROTECTED]>, > Simo Melenius <[EMAIL PROTECTED]> wrote: > > > I've sometimes replaced sys.stdout (and/or sys.stderr) to > > capture/redirect debugging information in existing code that has > > unwisely just "print"ed error and warning messages, instead of using >

Re: Rebinding stdout (was: Re: Python! Is! Truly! Amazing!)

2005-01-03 Thread michele . simionato
and explain what __stdout__ is intended for? Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Frameworks for "Non-Content Oriented Web Apps"

2005-01-04 Thread michele . simionato
ly really small. It also takes a little time to evaluate it. I suggest you to give a look at it. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Python evolution: Unease

2005-01-04 Thread michele . simionato
Maybe a PSF grant would help? I guess this has been considered ... Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: The Industry choice

2005-01-04 Thread michele . simionato
But then I have THREE published recipes!! Does that mean that I get three free copies of the cookbook ? ;-) Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 30)

2005-01-04 Thread michele . simionato
f8') >>> print german_ae # dunno if it will appear right on Google groups ä >>> german_ae.decode('latin1') Traceback (most recent call last): File "", line 1, in ? UnicodeEncodeError: 'ascii' codec can't encode character u

Re: Python evolution: Unease

2005-01-04 Thread michele . simionato
rgot to post ;-) http://www.python.org/psf/grants/ The one about the docs seems more about teaching scientists how to use Python. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 30)

2005-01-04 Thread michele . simionato
Yep, I did the same and got confused :-/ Michele -- http://mail.python.org/mailman/listinfo/python-list

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 30)

2005-01-04 Thread michele . simionato
... ;) I should probably ask for an unicode primer, I have found the one by Marc André Lemburg http://www.reportlab.com/i18n/python_unicode_tutorial.html and I am reading it right now. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Python evolution: Unease

2005-01-04 Thread michele . simionato
se to ship modified Python distributions, with missing modules or splitted in n separated packages to download separately. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Python evolution: Unease

2005-01-05 Thread michele . simionato
nce you cite descriptors, what's wrong with Raimond Hetting documentation? http://users.rcn.com/python/download/Descriptor.htm The only problem I see is that it is not integrated with the official docs, but this is a minor issue, I think. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Python evolution: Unease

2005-01-05 Thread michele . simionato
serious trouble with urpmi and lots of Python packages are available. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: python-dev Summary for 2004-11-16 through 2004-11-30

2005-01-06 Thread michele . simionato
> Would you like the source with your function? Yes, since I asked for this feature something like two years ago ;-) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: parameterized metaclass (or metametaclass)

2005-01-06 Thread michele . simionato
that you can use something like __metaclass__ = MyMetaclass.with(*args) # classmethod returning a metaclass Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: python3: 'where' keyword

2005-01-07 Thread michele . simionato
the link right now, but there are threads about the scope rules in python-dev, with various people protesting and Guido saying that he wants to keep them as they are. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: "A Fundamental Turn Toward Concurrency in Software"

2005-01-08 Thread michele . simionato
e only language I know supporting massive parallelization ...) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Returning same type as self for arithmetic in subclasses

2005-01-08 Thread michele . simionato
e it easy . I will not dispute the Timbot assessment ;) He is also right that people have already undergone under this level of torture: see http://tinyurl.com/6m373 for instance. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

readline, rlcompleter

2005-01-10 Thread michele . simionato
e_and_bind("tab: complete") but I don't find a list of recognized key bindings. For instance, can I would like to bind shift-tab to rlcompleter, is that possible? Can I use function keys? I did various attempt, but I did not succed :-( Is there any readline-guru here with some good po

Re: Python & unicode

2005-01-11 Thread michele . simionato
Uhm ... >>> class C(object): ... pass ... >>> setattr(C, "è", "The letter è") >>> getattr(C, "è") 'The letter \xe8' ;-) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Securing a future for anonymous functions in Python

2005-01-11 Thread michele . simionato
facility to manage callbacks in the standard library, then I would live pretty well without lambdas. Just IMHO, YMMV, etc. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Python & unicode

2005-01-11 Thread michele . simionato
ange(128) So you are right after all, but I though most people didn't know that you can have valid identifiers with accented letters, spaces, and non printable chars. > setattr(C, " ", "this works") > getattr(C, " ") Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

python and macros (again) [Was: python3: 'where' keyword]

2005-01-11 Thread michele . simionato
ther reasons if I think a bit more, but these should suffice for the moment ;) What I would be interested in is a Lisp/Scheme implementation compiling to Python bytecode, but I am not aware of any project in that direction. Michele Simionato P.S. some pointers for people interested on the topic

Re: Python & unicode

2005-01-11 Thread michele . simionato
lobals()["è"] 1 > According to the language reference, identifiers can only contain letters a-z and A-Z, > digits 0-9 and underscore. >http://docs.python.org/ref/identifiers.html The parser has this restriction, so it gets confused if it finds "è". But the underl

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-11 Thread michele . simionato
f of CPython bytecode. It would make much > more sense to have a Python implementation that compiles Python to > S-expressions and then lets a high performance Lisp or Scheme system > take care of the rest. This is a bizarre idea if you want to make Python run faster. It is not so bizarre if what you want is to have access to Python from Lisp/Scheme in the same sense Jython has access to Java. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: "private" variables a.k.a. name mangling (WAS: What is print? A function?)

2005-01-25 Thread michele . simionato
mental scripts for learning purpose. So I agree that the need does not occur often, but it is still an useful thing to have. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

FTP Server

2005-01-26 Thread michele . simionato
What's the simplest way to write an FTP Server in Python? A short research on the newsgroup and on the Cookbook did not bring out anything relevant (but I hear a little voice in the back of my head saying Twisted, Twisted! ...) Michele Simionato -- http://mail.python.org/mailman/listinfo/p

Re: FTP Server

2005-01-26 Thread michele . simionato
Do you have a code snippet/pointer so I have an idea of how to use it? M.S. -- http://mail.python.org/mailman/listinfo/python-list

Re: FTP Server

2005-01-26 Thread michele . simionato
> If you're after a simple FTP server, have a look at medusa. Uhm ... Medusa does not seem actively maintained nowadays. M.S. -- http://mail.python.org/mailman/listinfo/python-list

Re: python without OO

2005-01-27 Thread michele . simionato
believe Python is the definitive language, and it is probabily possible to introduce something better. It is just that nothing of the kind appeared until now, but I keep watching at the horizon ;) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: python without OO

2005-01-27 Thread michele . simionato
Peter Maas: >[EMAIL PROTECTED] schrieb: >> Davor is right: even if >> you do not want to use it, the stuff is *there* and somebody in your >> team will. So definitely there is an audience of programmers that just >> do not have an use for all the sophistication and actually are >> penalized by it.

Re: python without OO

2005-01-27 Thread michele . simionato
> "Perfection is achieved, not when there is nothing more to add, but > when there is nothing left to take away." Thanks, that was it! ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: future of computing languages

2005-01-30 Thread Michele Simionato
we will have colonies on Mars") We all know how it ended :-( Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Popularizing SimpleHTTPServer and CGIHTTPServer

2005-02-02 Thread Michele Simionato
Just submitted a recipe with this goal in mind: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/365606 Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: new style exception handleing

2005-02-03 Thread Michele Simionato
Google is your friend. This has been discussed a lot in the past. For instance, google for the thread, "Exceptions as New Style Classes", there was also a PEP by Steven Taschuk, IIRC. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: advice needed for simple python web app

2005-02-03 Thread Michele Simionato
in alpha. Don't let the "alpha" scares you: that means that the documentation is still a bit rough and few things are not fully settled down, but the framework is very much usable. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

making symlinks with distutils

2005-02-04 Thread Michele Simionato
r something like that? I could do that in various way, but I don't see the obvious one, maybe because I am not a Dutch ;) Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: making symlinks with distutils

2005-02-04 Thread Michele Simionato
>From what I see in the docs, registering a script just normalize the shebang line, but does not install it in /usr/bin, nor make any symbolic links, so it is not what I am looking for. I guess I need to add a os.link(src, dst) somewhere in the setup.py script or in a postinstallation script but I

Re: making symlinks with distutils

2005-02-04 Thread Michele Simionato
Sylvain Thenault: > Actually it does install it is $PREFIX/bin. Aha! And how do I set $PREFIX? Is it a Unix environment variable or is it a keyword argument in setup? Something like setup( prefix="/usr") ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is there no instancemethod builtin?

2005-06-19 Thread Michele Simionato
In this case I have used hasattr(obj, "__iter__") instead of isinstance(obj, list) (strings are iterable but do not have __iter__ method). I think hasattr is much better since it works for tuples and custom iterables too. Michele Simionato -- http://mail.python.org/mailma

Re: Why is there no instancemethod builtin?

2005-06-19 Thread Michele Simionato
ter(X) does not throw an exception". Objects following the __getitem__ protocol - such as strings -are iterables even if they do not have an __iter__ method. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: "static" data descriptors and possibly spurious calls to __set__?

2005-06-19 Thread Michele Simionato
est showing us what you get and what you would like to get? Michele Simionato Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Create our own python source repository

2005-06-21 Thread Michele Simionato
harder to build a useful application and fully comment it A part the Cookbook, I know of at least two Python books taking the approach you describe: 1. Dive into Python (Pilgrim) 2. Programming Python (Lutz) Dive into Python is free (and even translated in Italian on www.python.it, IIRC)

Re: Lisp development with macros faster than Python development?..

2005-07-06 Thread Michele Simionato
Fuzzyman: > So Lisp is for really good programmers, and Python is for > mediocre programmers ? Python is *also* for mediocre programmers. I see this as a strength, not as a weakness. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Web-Forms

2005-07-22 Thread Michele Simionato
Use twill:http://www.idyll.org/~t/www-tools/twill.html Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple inheritance super()

2005-07-27 Thread Michele Simionato
>I am mostly >using old style (without type unification) init but this motivate the >shift for the new style. Is there somewhere a document about this? Yes, see http://www.python.org/2.3/mro.html by yours truly Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

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

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

  1   2   3   4   5   6   7   8   9   >