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 |-->|+-+|
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
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
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
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
Not takers? This is my attempt to get some attention by bumping my own
post.
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
10 matches
Mail list logo