New fast PHP like scripting language
We are looking for hard core web developers that are interested in checking out a new PHP like scripting engine. The scripting language is called LSP, which means Lua Server Pages. Lua is a very fast and easily learned scripting language. Please sign up for our new group and start developing advanced LSP web-applications. We welcome your feedback. http://barracudaserver.com/examples/BarracudaDrive/bdwlsp.html Thanks, http -- http://mail.python.org/mailman/listinfo/python-list
Re: How to clean a module?
Yes, you are right. But from this problem, could I infer that the statement "del xxx" doesn't release the memory which xxx used? On May 31, 11:21 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > ai schrieb: > > > It assumes that there is a module A which have two global variables X > > and Y. If I run "import A" in the IDLE shell, then I can use A.X and > > A.Y correctly. But if I want to change the module A and then delete > > the variable Y, I find I can use A.Y just the same as before! > > In fact, I have tried all the following methods but can't remove the > > A.Y: > > execute "import A" again > > "reload(A)" > > "del A; import A" > > Yes, if you use "del A.Y", it works. But it is stupid since there are > > probably many names. In my thought, if no one references objects in A, > > "del A" will release all memory about A. But it seems that the fact is > > not. So I can not refresh the namespace to follow changes of a module > > easily and I will worry about the memory if I del a module. > > I want to know if there is a way to clear a module entirely. > > There might be other answers - but the easiest and IMHO best is to > simply restart the interpreter. Because whatever you type in there, you > could or should even (if it reaches some complexity) put in a small test > script - and execute that from the interpreter at a shell prompt. The > advantage is that you don't suffer from any side-effects e.g. IDLE has > (no Tk mainloop for example) and avoid the problems you describe > entirely. Together with a bunch of others. > > If you want/have to, you can drop into interpreter mode after script > execution with > > python -i myscript.py > > Diez -- http://mail.python.org/mailman/listinfo/python-list
Re: How to clean a module?
Perhaps you misundstand me. I means if you reedit a module file and reload it, the interpreter doesn't follow the change you have made exactly. For example, you import a module, edit the module file (you may remove a global variable or change its name), save the change, reload the module (or del the module and import it again). At last, you will find the origin variable still exists in the interpreter. If you don't notice this, you may meet some strange problems when you do refacting. On Jun 1, 12:17 am, Maric Michaud <[EMAIL PROTECTED]> wrote: > ai a écrit : > > > It assumes that there is a module A which have two global variables X > > and Y. If I run "import A" in the IDLE shell, then I can use A.X and > > A.Y correctly. But if I want to change the module A and then delete > > the variable Y, I find I can use A.Y just the same as before! > > It's unlikely to be true, see below. > > > In fact, I have tried all the following methods but can't remove the > > A.Y: > > execute "import A" again > > "reload(A)" > > "del A; import A" > > Yes, if you use "del A.Y", it works. But it is stupid since there are > > probably many names. In my thought, if no one references objects in A, > > "del A" will release all memory about A. But it seems that the fact is > > not. So I can not refresh the namespace to follow changes of a module > > easily and I will worry about the memory if I del a module. > > I want to know if there is a way to clear a module entirely. > > Actually I do not see your problem and your exact need, when I type the > following in python prompt I just see expected behavior, what is a > problem to you ? Maybe you could post a code explaining it. > > In [64]: import a > > In [65]: a.X > > Out[65]: 0 > > In [66]: a.X = 2 > > In [67]: del a > > In [68]: import a as b > > In [69]: b.X > > Out[69]: 2 > > In [71]: for name in [ n for n in b.__dict__ if not n.startswith('__') ] > : > : b.__dict__.__delitem__(name) > > : > > : > > In [72]: b.X > > --- > > Traceback (most recent call > last) > > C:\Documents and Settings\maric\Bureau\ in () > > : 'module' object has no attribute 'X' > > In [73]: reload(b) > > Out[73]: > > In [74]: b.X > > Out[74]: 0 > > In [75]: del b.X > > In [76]: del b > > In [77]: import a > > In [78]: a.b > > --- > > Traceback (most recent call > last) > > C:\Documents and Settings\maric\Bureau\ in () > > : 'module' object has no attribute 'b' -- http://mail.python.org/mailman/listinfo/python-list
Re: How to clean a module?
thx On Jun 1, 6:50 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > ai wrote: > > Yes, you are right. > > But from this problem, could I infer that the statement "del xxx" > > doesn't release the memory which xxx used? > > It just removes the name xxx from the current scope - which will result in a > reference counter decrease. If that was the last reference, the object will > be destroyed. Most times. There are some special cases involving the usage > of __del__-methods on objects. > > Diez -- http://mail.python.org/mailman/listinfo/python-list
Re: magic names in python
I don't think it is magic. If you think it is magic, can you talk about what's the better way and how can you implement the functions without any magic. I can't image a lauguage without special names. There are some special names even in Lisp. I guess you just hate the '__'. On Jun 4, 2:43 pm, per9000 <[EMAIL PROTECTED]> wrote: > Hi, > > I recently started working a lot more in python than I have done in > the past. And I discovered something that totally removed the pretty > pink clouds of beautifulness that had surrounded my previous python > experiences: magic names (I felt almost as sad as when I discovered > the strange pink worms that eat you in nethack, not to mention the > mind flayers - I really hate them). > > I guess all programming languages have magic names to some extent > (f.x. classes in the "C-family" have constructors that must have the > same name as the class (foo::foo) instead of foo.__init__). > > I just used a search engine a little on this topic and I found no > comprehensive list of magic names in python. > > So my questions: > * is there a comprehensive list of magic names in python (so far i > know of __init__ and __repr__)? > * are these lists complete or can magic names be added over time (to > the python "core")? > * are magic names the same in different python versions? > > I also tried (selected parts of(?)) the unittest package for use in > Zope and it seemed functions that I created for my test with the magic > prefix "test" were magic, other functions were not. > > So another question emerges: > * is the use of magic names encouraged and/or part of good coding > practice. > > Live long and prosper, > Per > > -- > > Per Erik Strandberg > home:www.pererikstrandberg.se > work:www.incf.org > also:www.spongswedencare.se -- http://mail.python.org/mailman/listinfo/python-list
Re: Python, Dutch, English, Chinese, Japanese, etc.
I am not a native English speaker. But I totally do not support PEP 3131. If a program is written in English and commented by other language, I am read it. But if a program is written in other language, it will be full unreadable by me even it is commented by English. I think language is just a tool used for intercommunion. The best situation is all people use only one language. -- http://mail.python.org/mailman/listinfo/python-list
How to clean a module?
It assumes that there is a module A which have two global variables X and Y. If I run "import A" in the IDLE shell, then I can use A.X and A.Y correctly. But if I want to change the module A and then delete the variable Y, I find I can use A.Y just the same as before! In fact, I have tried all the following methods but can't remove the A.Y: execute "import A" again "reload(A)" "del A; import A" Yes, if you use "del A.Y", it works. But it is stupid since there are probably many names. In my thought, if no one references objects in A, "del A" will release all memory about A. But it seems that the fact is not. So I can not refresh the namespace to follow changes of a module easily and I will worry about the memory if I del a module. I want to know if there is a way to clear a module entirely. -- http://mail.python.org/mailman/listinfo/python-list