Issue1467

classification
Title: attribute wrongly deemed 'read-only' if getter comes from a _templated_ interface
Type: Severity: normal
Components: Core Versions: 2.5.1, 2.5.0
Milestone:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: cgroves, doublep, fwierzbicki
Priority: Keywords:

Created on 2009-09-14.12:55:18 by doublep, last changed 2013-02-19.21:12:29 by fwierzbicki.

Messages
msg5153 (view) Author: (doublep) Date: 2009-09-14.12:55:17
Tested with 2.5.0 and 2.5.1rc2.  See also issue 1333.

Java code:

public interface Foo <Type>
{
    Type getFoo ();
}

public class FooImpl implements Foo <String>
{
    private String  foo;


    public String getFoo ()
    {
        return foo;
    }

    public void setFoo (String foo)
    {
        this.foo = foo;
    }
}

Python code:

import FooImpl

x = FooImpl (foo = 'bar')
print x.foo

Result:

Traceback (most recent call last):
  File "foo.py", line 3, in <module>
    x = FooImpl (foo = 'bar')
AttributeError: read-only attr: foo

Note that the template/generic (i.e. <Type>) seems to be essential. 
Otherwise there is no bug.
msg5154 (view) Author: (doublep) Date: 2009-09-14.13:17:15
After some investigation, I've found out that Java itself doesn't
consider this 'property' as writable because of the generics erasure...
 These Java pseudoproperties are really fucked up and I have had
uncountable problems with them :(

Should this be worked around in Jython or closed as wontfix because
that's the way Java "works"?
msg7699 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2013-02-19.21:12:29
I'd say it needs to be closed since it is how Java does it.
History
Date User Action Args
2013-02-19 21:12:29fwierzbickisetstatus: open -> closed
resolution: wont fix
messages: + msg7699
nosy: + fwierzbicki
2009-10-01 01:31:50pjenveysetnosy: + cgroves
2009-09-14 13:17:15doublepsetmessages: + msg5154
2009-09-14 12:55:18doublepcreate