Nov. 30, 2015
5:08 p.m.
On Mon, Nov 30, 2015 at 08:07:14AM -0800, Andrew Barnert wrote:
On Nov 30, 2015, at 02:32, Steven D'Aprano <steve@pearwood.info> wrote:
On Sun, Nov 29, 2015 at 11:31:14AM -0800, Andrew Barnert via Python-ideas wrote:
(How would you implement a write-only property that makes "print(spam.eggs)" raise an AttributeError except by raising it in the property function?)
eggs = property(None, setter, None, "")
makes eggs a write-only property. print(spam.eggs) gives
AttributeError: unreadable attribute
And how do you think property implements that?
Sorry, I misunderstood your (rhetorical?) question -- I read it as implying one should explicitly write a getter which raised AttributeError. -- Steve