What to study for each PCAP-31-04 domain
Modules and Packages
Covers importing modules, namespaces and the module search path via sys.path and dir(), creating user-defined modules and regular and nested packages with __init__.py and __pycache__, and managing third-party code with pip, PyPI and requirements.txt.
Key skills
Writing import statements, inspecting modules with dir(), structuring packages, and installing dependencies with pip from PyPI and requirements files.
Exceptions
Covers ordering except handlers, the else and finally clauses, the BaseException and Exception hierarchy including the args attribute, and raising, propagating and re-raising exceptions. It also covers defining custom exception classes for application-specific errors.
Key skills
Handling errors with try/except/else/finally, chaining and re-raising exceptions, and creating and raising custom exception types.
Strings
Covers ASCII, Unicode and UTF-8 encoding with ord() and chr(), string immutability and code-point comparisons, and the is...() validation methods. It also covers searching and inspecting strings with index(), find(), count(), startswith() and endswith(), and ordering characters with sorted().
Key skills
Encoding and decoding text, validating strings with the is...() methods, searching substrings, and comparing and sorting string data.
Object-Oriented Programming
Covers OOP principles, classes, objects, attributes and methods, and the distinction between instance and class variables, including __dict__ and name mangling. It also covers introspection with hasattr() and getattr() and the __name__, __module__ and __bases__ attributes, plus single and multiple inheritance, method resolution order, polymorphism and isinstance() checks.
Key skills
Designing classes with instance and class data, applying inheritance and method overriding, reading an MRO, and introspecting objects at runtime.
Advanced Python Constructs and I/O
Covers list, set and dictionary comprehensions, structural pattern matching with match/case, the loop else clause, lambdas with map() and filter(), and closures. It also covers working with text and binary streams, bytearray, file handling and the pathlib module for path manipulation.
Key skills
Writing comprehensions and pattern-matching code, using lambdas and closures, and reading and writing text and binary files with streams and pathlib.
Testing, Debugging, Collaborative Development, and AI Assistance
Covers writing unit test cases and assertions, reading tracebacks and debugging faulty code. It also covers collaborative development with repositories, branches, code reviews and CI workflows, and using AI assistance responsibly with independent validation and protection of sensitive data.
Key skills
Writing unit tests and assertions, debugging from tracebacks, working with branches, reviews and CI, and validating AI-generated code before use.