<div dir="ltr">Hi All,<div><br></div><div>1. defaultdict:</div><div>Rengaraj gave a talk on 'defaultdict'.</div><div>He covered how to set the default value by 'type' and function object.</div><div>Before this session I used to think the only purpose of 'defaultdict' was to avoid 'KeyError'. In this session I learnt that even the seemingly 'read' operation to a non-existent key lookup creates an entry in the dictionary. Moment you look for d['non-existent'] you get the 'key' named 'non-existent' with the default value.</div><div>He showed one program he wrote 3 years ago where he was summing the value of one key, without 'defaultdict' he needed to write 4 lines of code (if ... else) to do the same. With defaultdict he can just do it in one line.</div><div><br></div><div>2. Garbage collector in python:<br></div><div>Ibrahim gave a talk on 'Garbage collection in python'.</div><div><ul><li>Everything in python is 'PyObj' whose 3 key attributes are 'type', 'value' and 'refcount'.</li><li>If you have a=5 and b=5 there will be a single PyObj with the value '5' and two references to it from 'a' and 'b'. When 'a' or 'b' changes it creates another Pyobj with the new value and reduces the ref count of the old PyObj. You can confirm it by the 'id' function a=5, b=5 id(a) == id(b)</li><li>You can check the ref count of the object/variable using sys.getrefcount() interestingly in my simple program of a=5, sys.getrefcount(a) gives 21. Not sure what those '20' other references are. May be other items in the current stack/runtime with the value '5'.</li><li>Drawbacks of ref counter</li></ul>            a=[5]</div><div>            a.append(a) This creates a cyclical reference which would lead to 'a' never having '0' refcount and hence it would never be garbage collected.</div><div><ul><li>objgraph.show_refs generates a nice graphic of the object and its references.</li><li>Covered Various generations of objects and how they are garbage collected by looking for cyclic references.</li></ul>  ------------  <br></div><div>3. C++ adopting python ideas. Vijaykumar was sharing the C++ syntax enhancements inspired from python language.</div><div>(I had a few minutes internet connectivity issue during this session).<br></div><div><ul><li>C++17 (2017 standard/edition): range based loops</li></ul></div><div>for (auto m: list) {<br>}<br></div><div><ul><li>structured bindings(a.k.a tuple unpacking in python)<br>pair <int, string> foo()<br>{<br>return {1, "hello world"};<br>}<br><br>auto [line, str] = foo();<br></li><li>C++20 export, import module.</li></ul>4. Ranga gave a lightning talk on kubernetes installation on AWS.</div><div><br></div><div>Thanks</div><div>With regards</div><div>Kamesh Jayachandran</div></div>