Carl Friedrich Bolz wrote:
Bruno Desthuilliers wrote:
Martin P. Hellwig a écrit :
I created a class which creates a relative unique id string, now my
program just works fine and as expected but somehow I get the feeling
that I misused the __repr__ since I guess people expect to 'execute'
Martin P. Hellwig wrote:
Bruno Desthuilliers wrote:
cut
Why not just use the call operator instead ? ie:
id = IDGenerator(...)
id()
01_20060424_151903_1
id()
01_20060424_151905_2
Because of:
id = IDGenerator(01,99)
id()
Traceback (most recent call last):
File
bruno at modulix wrote:
Martin P. Hellwig wrote:
Bruno Desthuilliers wrote:
cut
Why not just use the call operator instead ? ie:
id = IDGenerator(...)
id()
01_20060424_151903_1
id()
01_20060424_151905_2
Because of:
id = IDGenerator(01,99)
id()
Traceback (most recent call
cut
Thanks for the input folks!
I adapted my script to the given suggestions and it's now far more
'logical', for reference I added it below.
--
mph
- script -
import string
import time
class IDGenerator(object):
(leading_id, subversion_length, tz) # tz = 'local' or 'gm'
Hi all,
I created a class which creates a relative unique id string, now my
program just works fine and as expected but somehow I get the feeling
that I misused the __repr__ since I guess people expect to 'execute' a
function in an instance instead of using it's representation string of
the
Martin P. Hellwig a écrit :
Hi all,
I created a class which creates a relative unique id string, now my
program just works fine and as expected but somehow I get the feeling
that I misused the __repr__ since I guess people expect to 'execute' a
function in an instance instead of using
Martin P. Hellwig wrote:
Hi all,
I created a class which creates a relative unique id string, now my
program just works fine and as expected but somehow I get the feeling
that I misused the __repr__ since I guess people expect to 'execute' a
function in an instance instead of using it's
Bruno Desthuilliers wrote:
Martin P. Hellwig a écrit :
I created a class which creates a relative unique id string, now my
program just works fine and as expected but somehow I get the feeling
that I misused the __repr__ since I guess people expect to 'execute' a
function in an instance
Bruno Desthuilliers wrote:
Martin P. Hellwig a écrit :
I created a class which creates a relative unique id string, now my
program just works fine and as expected but somehow I get the feeling
that I misused the __repr__ since I guess people expect to 'execute' a
function in an instance
Bruno Desthuilliers wrote:
cut
Why not just use the call operator instead ? ie:
id = IDGenerator(...)
id()
01_20060424_151903_1
id()
01_20060424_151905_2
Because of:
id = IDGenerator(01,99)
id()
Traceback (most recent call last):
File pyshell#1, line 1, in ?
id()
keirr wrote:
Martin P. Hellwig wrote:
Hi all,
I created a class which creates a relative unique id string, now my
program just works fine and as expected but somehow I get the feeling
that I misused the __repr__ since I guess people expect to 'execute' a
function in an instance instead of
Am Donnerstag 04 Mai 2006 01:04 schrieb Martin P. Hellwig:
Because of:
id = IDGenerator(01,99)
id()
Traceback (most recent call last):
File pyshell#1, line 1, in ?
id()
TypeError: 'IDGenerator' object is not callable
But i do appreciate your comment, thanks!
You need to
12 matches
Mail list logo