dictionaries/pointers

2005-10-07 Thread Rob Conner
I dont know how to do this and can't think of a simple way to. All I want is a dictionary where two keys point to the same object. (to steal the ascii art from http://starship.python.net/crew/mwh/hacks/objectthink.html) I want sometihng like this: ,--. +---+ | dict |-->|+-+|

Re: Redundant code in multiple methods

2005-09-13 Thread Rob Conner
Genius! Thanks guys that was exactly the help I was looking for. I'll be implementing this later today. I don't forsee any problems, so if I don't post anything else, thank you so much for the help. -- http://mail.python.org/mailman/listinfo/python-list

Redundant code in multiple methods

2005-09-09 Thread Rob Conner
No you don't need to know Zope to help me. The whole reason I'd even want to do this is because of Zope though. I made a Zope product, and now want to perfect it. some simple example code... class User: def View(self): # play with data here myHtmlDoc = "pretend this is a upe

Re: providing arguments to base.__init__

2005-08-10 Thread Rob Conner
seems like you are not running the correct wavePlayer. make sure you don't have 2 wavePlayer vars. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does __init__ not get called?

2005-08-10 Thread Rob Conner
I'm out of my league too. I don't know enough about __new__ and __init__. I just went another route and did a wrapper for datetime, and didn't extend it. Thanks for the effort. By chance... does anyone know, if I wrote a class, and just wanted to override __new__ just for the fun of it. What would

Re: Why does __init__ not get called?

2005-08-09 Thread Rob Conner
Not takers? This is my attempt to get some attention by bumping my own post. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does __init__ not get called?

2005-08-09 Thread Rob Conner
Ah ok, thats interesting I hadn't even tried a valid date yet. Now how do I get this thing to call __init__ when I pass in an invalid date and the ValueError is thrown and caught within __new__. dt = DateTime(2005, 02, 30) -- http://mail.python.org/mailman/listinfo/python-list

Why does __init__ not get called?

2005-08-08 Thread Rob Conner
I'm still working on my DateTime class from last week... Why does __init__ not get called? The docs at http://www.python.org/dev/doc/devel/ref/customization.html read "If __new__() returns an instance of cls, then the new instance's __init__() method will be invoked" and as far as I can tell cls i

Re: inheriting from datetime

2005-08-01 Thread Rob Conner
gah, yeah that was strange. but i got it now. thanks. > side question: what is the point of accepting invalid dates? thats a long story. but it would be nice to have invalid dates at least just stored. so i want to try to put a class together that does it. -- http://mail.python.org/mailman/listi

inheriting from datetime

2005-08-01 Thread Rob Conner
So this is simple, why can't I run the following code? I've tried many variances of this, but simply cannot inherit from datetime or datetime.datetime. I get this on line 3. TypeError: function takes at most 2 arguments (3 given) import datetime _datetime = datetim