Implementing the Python List (list) Class in C

Published: 19 March 2023
on channel: Chuck Severance
2,040
65

This lecture details the implementation of a Python list class in C using a linked list structure. The PyList object contains head and tail pointers and a count field. The implementation appends strings, prints the list, checks the length, and performs index lookups, returning negative one for missing elements.

The destructor traverses the linked list from head to tail, freeing each node's string data before the node itself to avoid memory leaks. The list printing method uses printf to output the list in Python-like format without string concatenation, and the lecture covers the implementation of the len, index, and append methods.

For more materials, auto graders, and more courses, please see www.masterprogrammer.com.


On this page of the site you can watch the video online Implementing the Python List (list) Class in C with a duration of hours minute second in good quality, which was uploaded by the user Chuck Severance 19 March 2023, share the link with friends and acquaintances, this video has already been watched 2,040 times on youtube and it was liked by 65 viewers. Enjoy your viewing!