#python - Mon 19 Mar 2007 between 21:53 and 22:01

NY Lost Funds



sjbrownHydrant, why can't you write out the classes sequentially?
prologicsince when can you _not_ set a SIGTERM handler to a method of some class ?
koshHydrant: so you have cross dependent classes or something?
hydrantkosh: Yes.
koshHydrant: so a inherits from b and b inherits from a or something like that?
KirkMcDonaldProbably not "inherits"...
Maybe they contain each other as members?
hydrantkosh: No... a base class contains others as members as KirkMcDonald said
koshI don't see why that should be a problem
KirkMcDonaldSo... each class's __init__ needs to create an instance of the other class?
hydrantkosh: I may be able to refactor my design, which is what I'm pondering right now
blankyhey guys I got an offtopic question, are all md5 hashes the same length?
KirkMcDonaldHydrant: The first thing that springs to mind is splitting it into two modules.
koshpython allows more flexible systems then c++ can realy do
KirkMcDonaldblanky: Yes, I believe so.
hydrantkosh: Hey I know Python's flexible, it's just the whole no class declaration thing :-)
blankyare all md5 hashes 32 characters long
okay thanks KirkMcDonald
koshyou do declare classes
KirkMcDonaldYou can't /forward/ declare classes. :-)
koshclass Whatever .......
KirkMcDonaldBut it doesn't matter, I think.
koshKirkMcDonald: I can't think of any good reason to do that
computerlinguistblanky: 32 hex values, actually (128 Bit)
KirkMcDonaldHydrant: It should Just Work, now that I think about it, if you're referencing the other class inside of methods.
koshanything inside __init__ is run after all the classes are constructed anyways
hydrantKirkMcDonald: Well, basically I'm writing a parser and I'd like to say what possible tokens could be found for each token processed... the way I've done this is to represent the token types as classes, and I'd like to have a list of valid token classes...
blankythere's no substring function in python is there? I was trying to look for the simplest way to cut off at 32nd character, or until the first space is reached, what do you guys suggest?
KirkMcDonaldHydrant: Then I would point you at Pyparsing. :-)
hydrantKirkMcDonald: I'd like the classes to be in a list
koshblanky: somestring[:32] would cut off at the 32nd char
Hydrant: what are these tokens?
Hydrant: just strings?
blankykosh: thanks, so I can do mystring = mystring[:32], thanks!
KirkMcDonaldHydrant: Even if you find Pyparsing lacking in some way, it has a solution to the forward reference thing you might find useful.
aconbereblanky: have you read the python tutorial?
slices are pretty basic python
hydrantKirkMcDonald: Can't, assignment for class :-)
KirkMcDonald: But thanks
KirkMcDonaldHah

Page: 3 10 17 24 31 38 45 52 59 66 73 80 87 

IrcArchive

NY Lost Funds