From 9ed7e5e94dea554d0c802baef0136ca05ff80dff Mon Sep 17 00:00:00 2001 From: Michael van der Kamp Date: Sat, 6 Mar 2021 15:52:47 -0600 Subject: [PATCH] Add a namedtuple to debug_me, to showcase attr visibility in containers --- debug_me.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debug_me.py b/debug_me.py index f9f4a9a..549d348 100644 --- a/debug_me.py +++ b/debug_me.py @@ -1,3 +1,8 @@ +from collections import namedtuple + +Colour = namedtuple('Colour', ['red', 'green', 'blue', 'alpha']) + + class MyClass(object): def __init__(self, a, b): self.a = a @@ -19,6 +24,7 @@ def simple_func(x): y = dict((i, i**2) for i in s) k = set(range(5, 99)) + c = Colour(137, 214, 56, 88) try: x.invalid