Appendix A. Python Best Practices

In this book, we used many Python features without diving into the details about how they work. There were also various other issues that were mentioned which could use more explanation. In this appendix, we will cover those topics in more detail. This chapter does not need to be read sequentially; if you are familiar with a topic, feel free to skip its section.

The args and kwargs parameters

We frequently use functions and methods with asterisk or star characters (*) in their definitions, as shown in the following code snippet:

def spam(*args, **kwargs):
    ...

Programmers unfamiliar with Python are often puzzled when they encounter this for the first time. What does the single and double asterisk/star character do? ...

Get Practical Maya Programming with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.