Joseph Garvin wrote:
>
> I'm curious -- what is everyone's favorite trick from a non-python
> language? And -- why isn't it in Python?
>
1. Lisp's "dynamically scoped" variables (Perl has them, and calls them
"local", but as far as I've seen their use their is discouraged). These
are global variab
;
This introduces the same problem you noted with my original proposal,
but in reverse: Now, in bar(), you define and use a local variable, and
suddenly some library function changes its behavior misteriously.
> For my example above, bar would *always* print 10. Nothing that
> foo.foogle did wo
Mike Meyer wrote:
> "Shai" <[EMAIL PROTECTED]> writes:
>
> > They're called "Special vars", and you need to define them (unlike
> > local LISP variables, which behave essentially like Python vars), but
> > then you use them just like other v
Since nobody else mentioned this...
Python classes have a magic method called __del__ which is usually
called just before an object is garbage-collected. Further, Python
uses reference-counting to tell when an object is no longer
accessible. This means that if your resource classes define __del__
7; in parents"%self.name)
func.__doc__ = source.__doc__
return func
doc_inherit = DocInherit
Combining docstrings (as suggested by Jean-Paul Calderone), and
taking proper care of classmethods and staticmethods, are left
as an exercise to the reader.
Have fun,
Shai.
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 27, 5:05 pm, Jean-Michel Pichavant
wrote:
> Ben Finney wrote:
> >
> > The docstring for ‘FooGonk.frobnicate’ is, intentionally, perfectly
> > applicable to the ‘BarGonk.frobnicate’ method also. Yet in overriding
> > the method, the original docstring is not associated with it.
>
> I've also
On Jul 26, 6:55 pm, a...@pythoncraft.com (Aahz) wrote:
>
> Nice! Maybe stick this on the Cookbook?
http://code.activestate.com/recipes/576862/
Thanks for the suggestion,
Shai.
--
http://mail.python.org/mailman/listinfo/python-list
can you pls help me to make a database program in python? It is a Quiz system
which is database driven. The program has a choices which add question, edit,
delete, list, take a quiz, quiz results, and exit. in take a quiz
choice,questions should be randomly displayed and the result and name of t
can you pls help me to make a database program in python? It is a Quiz system
which is database driven. The program has a choices which add question, edit,
delete, list, take a quiz, quiz results, and exit. in take a quiz
choice,questions should be randomly displayed and the result and name of t