t;> id(y.var)
11228488
>>> id(x.func)
14430976
>>> id(y.func)
14433656
>>>
On Nov 23, 2007 3:29 PM, Roc Zhou <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm now being confused by this segment of code:
> >>> class Test:
> ... var = 1
>
Hello,
I'm now being confused by this segment of code:
>>> class Test:
... var = 1
... def func(self): pass
...
>>> x = Test()
>>> y = Test()
>>> x.var is y.var
True
>>> x.func is y.func
False
>>> id(x.var); id(y.var)
146132400
146132400
>>> id(x.func); id(y.func)
-1208243388
-1208243388
Hello,
Recently I'm working on a new data structure written in python: Tree,
by operator overloading. I want it can act as a builtin type, such as
list and dict, but do something like a tree, to make those things need
trees can be more convenient.
For example,
1. to create a Tree, there are sever
Now I meet a strange problem.
After the first sync init, it enters to the realtime replication state. I
deployed them on 3 machines, and have run near half month. Suddenly one day,
a host, I don't know what's wrong, I found fs_mirror get the empty
records from its mirrord agent. In normal conditio
Recently I started an open source project "cutils" on the sourceforge:
http://sourceforge.net/projects/crablfs/
The document can be found at:
http://crablfs.sourceforge.net/#ru_data_man
This project's mirrord/fs_mirror tool is a near realtime file system
mirroring application across 2 or more
Hello:
Recently I started an open source project "cutils" on the sourceforge:
http://sourceforge.net/projects/crablfs/
The document can be found at:
http://crablfs.sourceforge.net/#ru_data_man
This project's mirrord/fs_mirror tool is a near realtime file system
mirroring application across 2
-- Forwarded message --
From: Roc Zhou <[EMAIL PROTECTED]>
Date: Oct 19, 2007 12:48 AM
Subject: Re: Pyinotify : which user ?
To: Sébastien Weber <[EMAIL PROTECTED]>
The command lsof or fuser can report who is using the file, maybe you can
have a look at their source co
mirrord/fs_mirror makes use of inotify, which is a functionality afforded
by the recent Linux (from 2.6.12). It is a counterpart of FAM, since Linux
FAM has stopped so long.
On 10/17/07, Roc Zhou <[EMAIL PROTECTED]> wrote:
>
> Hello:
>
> Recently I started an open source proje
Hello:
Recently I started an open source project "cutils" on the
sourceforge:
https://sourceforge.net/projects/crablfs/
The document can be found at:
http://crablfs.sourceforge.net/#ru_data_man
This project's mirrord/fs_mirror is a near realtime file system
mirroring application across 2 or more
Recently I tried to create a new data structure in python: Tree, by operator
overloading. I want it can act as a builtin type, such as list and dict.
Luckily the basic definition has been finished now, the document is in the
code and unittest. And I have put the HTML doc at:
http://crablfs.source
I'm sorry but I still have a question, look at this example:
>>> class test:
... def __init__(self):
... self.x = 1
... def __getattr__(self, attr_name):
... print attr_name
... if attr_name == 'y':
... return 2
... else:
... raise Att
return hex(id(self))
On 6 22 , 1 48 , Roc Zhou <[EMAIL PROTECTED]> wrote:
> I know what's wrong. Thank you. And I think
> try:
> return self.__dict__[attr_name]
> is unnecessary, because python will do it itself for us.
>
> So now I have to overload __str__, bu
12 55 , "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
> En Fri, 22 Jun 2007 00:30:43 -0300, Roc Zhou <[EMAIL PROTECTED]>
> escribió:
>
> > Now I have to design a class that overload __getattr__, but after
> > that, I found the __repr__ have been affected.
from gettext import gettext as _
__doc__ = _("""module docstrings""")
class test:
__doc__ = _("""class docstrings""")
def __setattr__(self, attr_name, value):
_("""class method docstrings""")
But I found when the module and class docstrings take effect(must use
__doc__ to specify i
Now I have to design a class that overload __getattr__, but after that, I
found the __repr__ have been affected. This is a simple example model:
#!/usr/bin/env python
class test:
def __init__(self):
self.x = 1
def __getattr__(self, attr_name):
try:
return self.__dic
Now I have to design a class that overload __getattr__, but after
that, I found the __repr__ have been affected. This is a simple
example model:
#!/usr/bin/env python
class test:
def __init__(self):
self.x = 1
def __getattr__(self, attr_name):
try:
return self._
Now I have to design a class that overload __getattr__, but after
that, I found the __repr__ have been affected. This is a simple
example model:
#!/usr/bin/env python
class test:
def __init__(self):
self.x = 1
def __getattr__(self, attr_name):
try:
return self._
Now I have to design a class that overload __getattr__, but after
that, I found the __repr__ have been affected. This is a simple
example model:
#!/usr/bin/env python
class test:
def __init__(self):
self.x = 1
def __getattr__(self, attr_name):
try:
return self.
18 matches
Mail list logo