On 01/02/2010 23:58, Jeff Hardy wrote:
On Mon, Feb 1, 2010 at 2:46 PM, Dino Viehland<di...@microsoft.com>  wrote:
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.
Presumably then str and unicode would no longer be equal? Or are you
thinking of something fancier?

They would still be the same object - so would continue to compare equal and have the same identity. What I'm suggesting is similar to how Python 3 treats the use of super - and that is compile different code when you call str(...) from when you call unicode(....) - only when you use those literal identifiers in source code.

Any use of them other than calling them directly would continue to behave as IronPython does currently.

Also, in what cases would anyone *want* to alias unicode?

Well, like aliasing super in Python 3, with my suggestion that would then be broken (or at least would fall back to standard str behaviour). As this is uncommon anyway it shouldn't break *much* code.

All the best,

Michael


- Jeff
_______________________________________________
Users mailing list
Users@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.


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

Reply via email to