Re: alphanumeric list

2011-03-16 Thread not1xor1 (Alessandro)
Il 15/03/2011 09:10, yqyq22 ha scritto: I would like to put an alphanumeric string like this one EE472A86441AF2E629DE360 in a list, then iterate inside the entire string lenght and change each digit with a random digit. Do u have some suggestion? thanks a lot hi I'm not an experienced python

Re: subclassing str

2010-11-10 Thread not1xor1 (Alessandro)
Il 09/11/2010 03:18, Lawrence D'Oliveiro ha scritto: How exactly does a.f(b, c) save time over f(a, b, c) unfortunately in real world you have: objId = objId.method(args) vs. objId = moduleName.method(objId, args) I know you can use "from moduleName import *", but IMHO that pro

Re: subclassing str

2010-11-07 Thread not1xor1 (Alessandro)
Il 07/11/2010 07:41, Chris Rebert wrote: You could subclass UserString instead of str; all of UserString's methods seem to ensure that instances of the subclass rather than just plain strs or UserStrings are returned. See http://docs.python.org/library/userdict.html#UserString.UserString I'll

subclassing str

2010-11-06 Thread not1xor1 (Alessandro)
Hi, I'd like to know what is the best way to subclass str I need to add some new methods and that each method (both new and str ones) return my new type For instance I've seen I can do: class mystr(str): def between(self, start, end): i = self.index(start) + len(start) j = se