# HG changeset patch # User Paul Boddie # Date 1363734337 -3600 # Node ID 89eed32aeed38ece4421f959d80a9ba5c72bd998 # Parent e8f899820cdf98d034d017b039b9f61242ec5569 Added tests of literal constant attribute access and indirect __class__ access on classes. diff -r e8f899820cdf -r 89eed32aeed3 tests/attribute_access_constant_direct.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/attribute_access_constant_direct.py Wed Mar 20 00:05:37 2013 +0100 @@ -0,0 +1,7 @@ +#!/usr/bin/env python + +f1 = "Hello".__len__ + +result1_5 = f1() + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r e8f899820cdf -r 89eed32aeed3 tests/class_class_attr_indirect_in_function.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/class_class_attr_indirect_in_function.py Wed Mar 20 00:05:37 2013 +0100 @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +class A: + pass + +class B(A): + pass + +class C: + pass + +def f(x): + return x.__class__ + +a = f(A) +b = f(B) +c = f(C) + +result_1 = a is type and 1 or 0 +result_2 = b is type and 2 or 0 +result_3 = c is type and 3 or 0 + +# vim: tabstop=4 expandtab shiftwidth=4