This website hosts supplementary material for the labs on Tuesday at 14:15 and on Wednesday at 16:15. You can find my slides as well as answers to the questions that the students raised.
The lecture to this lab is given by prof. Marcin Młotkowski. Most study materials from the lecture will be found in the SKOS education system, I believe.
Lab 01: Introduction, string type, basic string functions. Slides.
Q: Is the int type safe from overflows?
A: Yes, it is by default represented as a long integer (we can think of it as a list of 64-bit numbers). A long time ago this was not the case, but it has been like this since Python 2.4. Be mindful of the fact that float works more C-style, with a fixed representation.
It is interesting to note that this design decision actually results in a vulnerability to denial of service attacks, and recent Python (since 3.10) actually offers a way to set int-to-string conversion limits to avoid this vulnerability. See more here.
Lab 02: What is and is not Pythonic. Slides, example code.
Students: The in keyword is O(1) for objects of type range.
Indeed, that is the case! The range() function does create objects of type range, which are not represented as lists, but only as the three numbers describing the range. They offer for in linear-time iterability, but testing containment is indeed constant time, just checking the ranges and if the element hits the step or misses the step. See more in a question on Stack Overflow.
Lab 06:
Lab 11: Memory management in CPython. Slides, video presentation (19.5 minutes).
16:00 - 16:10: M.S.
16:10 - 16:20: M.A.
16:20 - 16:30: M.M.
16:30 - 16:40: O.K.
16:40 - 16:50 : M.C.
16:50 - 17:00: slot available
17:00 - 17:10: slot available
17:10 - 17:20: slot available
17:20 - 17:30: slot available
17:30 - 17:40: slot available
17:40 - 17:50: slot available
17:50 - 18:00: slot available
18:00 - 18:10: slot available
18:10 - 18:20: Z.K.
18:20 - 18:30: W.O.
18:30 - 18:40: V.G.
18:40 - 18:50: M.U.
18:50 - 19:00: slot available
19:00 - 19:10: slot available
19:10 - 19:20: slot available
19:20 - 19:30: slot available
19:30 - 19:40: slot available
19:40 - 19:50: slot available
19:50 - 20:00: P. K.