# HG changeset patch # User Paul Boddie # Date 1394385977 -3600 # Node ID 7439ffa2b34faebb2e0c1a53d1f8d1e780ccddd3 # Parent 257aa2d84abee5b14aeb6376d287af9a0db9356c Added another example illustrating that attributes must be defined "internally" at least once in order to be associated with a class. diff -r 257aa2d84abe -r 7439ffa2b34f tests/failure/attributes_instance_assignment_external_only_indirect.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/failure/attributes_instance_assignment_external_only_indirect.py Sun Mar 09 18:26:17 2014 +0100 @@ -0,0 +1,16 @@ +#!/usr/bin/env python + +class C: + def __init__(self, a): + self.a = a + +def f(obj, b): + obj.a + obj.b = b + +c = C(1) +f(c, 2) +result_1 = c.a +result_2 = c.b + +# vim: tabstop=4 expandtab shiftwidth=4