Add a namedtuple to debug_me, to showcase attr visibility in containers

This commit is contained in:
Michael van der Kamp 2021-03-06 15:52:47 -06:00
parent f9d9847d09
commit 9ed7e5e94d

View File

@ -1,3 +1,8 @@
from collections import namedtuple
Colour = namedtuple('Colour', ['red', 'green', 'blue', 'alpha'])
class MyClass(object): class MyClass(object):
def __init__(self, a, b): def __init__(self, a, b):
self.a = a self.a = a
@ -19,6 +24,7 @@ def simple_func(x):
y = dict((i, i**2) for i in s) y = dict((i, i**2) for i in s)
k = set(range(5, 99)) k = set(range(5, 99))
c = Colour(137, 214, 56, 88)
try: try:
x.invalid x.invalid