Terry Hancock schrieb:
> I don't know about the backwards compatibility issue. I'm not sure
> what would be affected. But "print" frequently generates encoded
> Unicode output if the stream supports it, so there is no guarantee
> whether it produces unicode or string output now.
I'm not worried a
Martin v. Löwis wrote:
> Terry Hancock schrieb:
> > Or, put another way, what exactly does 'print' do when it gets a
> > class instance to print? It seems to do the right thing if given a
> > unicode or string object, but I cant' figure out how to make it do
> > the same thing for a class instance
Terry Hancock schrieb:
> Is it possible to define some combination of __repr__, __str__,
> and/or __unicode__ so that the unicode() wrapper isn't necessary
> in this statement:
I'm not aware of a way of doing so.
> Or, put another way, what exactly does 'print' do when it gets
> a class instance
I still run into my own ignorance a lot with unicode in Python.
Is it possible to define some combination of __repr__, __str__,
and/or __unicode__ so that the unicode() wrapper isn't necessary
in this statement:
>>> print unicode(jp.concepts['adjectives']['BLUE'][0])
(i.e. can I make it so tha