public abstract class Object
{
    protected string weakName = string.Empty;

    public string WeakName
    {
        get { return this.weakName; }
        protected set { this.weakName = value; }
    }
}

public class Derived
{
    public Derived()
    {
        this.WeakName = "Hello";
    }
}

In C#:
Derived obj = new Derived();
Console.WriteLine(obj.WeakName)
Hello
obj.WeakName = "Fail";
The property or indexer 'Object.WeakName' cannot be used in this context
because the set accessor is inaccessible

In IPy:
>>> obj = Derived()
>>> obj.WeakName = 'Succeed'
>>> obj.WeakName
'Succeed'

Is this expected behavior?

___________________________
Matthew Barnard
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to