>> class Foo(Freezeable):
>> def __init__(self):
>> self.bar = 42
>> self.freeze() # ok, we set all variables, no more from here
>>
>>
>> x = Foo()
>> print x.bar
>> x.bar = -42
>> print x.bar
>> x.baz = "OMG! A typo!"
>>
>
>Pretty nice, but unfortunately the subclass has to remember to call freeze
Quoting Bryan Olson <[EMAIL PROTECTED]>:
> Robert Bossy wrote:
> > Bryan Olson wrote:
> >> Robert Bossy wrote:
> Robert Bossy wrote:
> > Indeed! Maybe the best choice for chunksize would be the file's buffer
> > size...
> >>
> >> That bit strikes me as silly.
> >>
> > The size of the
Quoting "Martin v. Löwis" <[EMAIL PROTECTED]>:
> >> os.chdir("~/dir1")
> >
> > It is not mentioned in the documentation but I'm pretty sure os.dir()
> doesn't do
> > tilde expansion since this is usually performed by a shell.
> >
> > You should use instead:
> >
> > os.chdir(os.join(os.environ['HOM
Quoting Maryam Saeedi <[EMAIL PROTECTED]>:
> I have a problem using os.chdir on linux. What should I do if I want to
> change to root directory? The below does not work:
>
> os.chdir("~/dir1")
It is not mentioned in the documentation but I'm pretty sure os.dir() doesn't do
tilde expansion since t
Quoting Mike D <[EMAIL PROTECTED]>:
> Hello, I've spent the morning trying to parse a simple xml file and have the
> following:
> import sys
> from xml.dom import minidom
>
> doc=minidom.parse('topstories.xml')
>
> items = doc.getElementsByTagName("item")
> text=''
> for i in items:
> t = i.fi
Quoting Raymond Hettinger <[EMAIL PROTECTED]>:
> [Robert Bossy]
> > I thought it would be useful if insort and consorts* could accept the
> > same options than list.sort, especially key and cmp.
>
> If you're going to do many insertions or searches, wouldn't it be
> *much* more efficient to store
Selon Raymond Hettinger <[EMAIL PROTECTED]>:
> [Robert Bossy]
> > I thought it would be useful if insort and consorts* could accept the
> > same options than list.sort, especially key and cmp.
>
> If you're going to do many insertions or searches, wouldn't it be
> *much* more efficient to store yo
Quoting Steve Holden <[EMAIL PROTECTED]>:
> [...]
> Not only that, but all pointers to an object have to be updated when it
> is relocated.
"Any problem in computer science can be solved by another level of indirection"
-- David John Wheeler
;-)
RB
--
http://mail.python.org/mailman/listinfo/py
Hi,
In the standard library module "operator", it would be nice to have a dictionary
mapping operators strings with their respective functions. Something like:
{
'+': add,
'-': sub,
'in': contains,
'and': and_,
'or': or_,
...
}
Rationale:
Recently I had to implemen