[IronPython] Django, __unicode__, and #20366

Michael Foord fuzzyman at voidspace.org.uk
Mon Feb 1 13:49:45 PST 2010


On 01/02/2010 21:46, Dino Viehland wrote:
>> How about having str and unicode as different objects internally - so
>> IronPython can tell the difference - but fake equality and identity
>> checks *inside* IronPython. :-)
>>
>> Or do something a bit similar to what Python 3 does with super...
>> Compile different code for str(...) and unicode(...). I think I prefer
>> that to the above. :-)
>>
>>      
> Messing with identity starts to get really scary and I'd rather not go
> there - I'm sure there will be lots of edge cases which will be broken.
>
>    

I can imagine.

> I could see is making unicode(foo) do something different.  If you aliased
> unicode then you'd get str's behavior though but that might be perfectly
> acceptable.  It's definitely a solution I had not considered and it'd
> probably fix multiple issues.
>
>    

It might be worth a try if it isn't too much work. I think it would help 
*most* situations, aliasing unicode and str isn't *that* common.

Michael

>
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>    


-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog

READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer.




More information about the Users mailing list