No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
4 Posted Topics
I've been writing a Python module which contains a few classes. As I have come to use the module in earnest it has become clear that I need to create a _very_ large number of instances of these classes. This is using more memory than I would like. Speed is … | |
Re: Interesting, I've never used 2D arrays in Python but I would have hacked it to be useable in 'C-like' manner: [CODE]class sphere(): def __init__(self, x=0.0, y=0.0, z=0.0): self.x = x self.y = y self.z = z def __str__(self): return "Coords: %s %s %s"%(self.x,self.y,self.z) n = 10 m = 10 myArray … | |
I'm having trouble understanding why I can't seem to access a dict object of a class once the class instance is referenced through a dict of instances. If that makes sense at all ;) I have a simple class containing only a dict called index. [CODE]class Node: def __init__(self): self.index … | |
I've just started learning Python but have hit a little issue when instancing a class. I seem to get errors like: AttributeError: type object 'Stuff' has no attribute 'a' or: AttributeError: class 'Stuff' has no attribute 'a' Clearly I'm missing something fairly fundamental :/ A quick test program shows what … |
The End.