Opened 17 years ago
Closed 17 years ago
#5560 closed (fixed)
unicode lazy strings don't work on Jython
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Uncategorized | Version: | dev |
Severity: | Keywords: | jython | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The problem is that on Jython __unicode__
lives on object (just like __str__
), so assigning the __unicode__ attribute to lazy instances don't work there.
Attachments (1)
Change History (5)
by , 17 years ago
Attachment: | lazy_unicode.patch added |
---|
comment:1 by , 17 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 17 years ago
Well, Jython now dropped object.__unicode__
, but a __unicode__
method assigned specifically to an instance doesn't work.
In fact, on CPython it seems that the only __*__
method that works when assigned to an instance is __unicode__
(all the others are looked up on the type, not the instance).
So, this patch still sounds reasonable, as the original code relies on a obscure implementation detail of CPython.
comment:3 by , 17 years ago
Nice idea. I hadn't realised the significance of creating a new __proxy__
each time. This is much neater than what we're doing in __str__
, so I'll change that, too.
comment:4 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Simple patch, works ok on CPython.