migration-1.3-python-function-whitespace.html 1.7 KB

1234567891011121314151617181920212223242526272829
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  4. <title>4.1.2.1. Python Function Whitespace</title>
  5. <link rel="stylesheet" type="text/css" href="../book.css">
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
  7. <link rel="home" href="index.html" title="The Yocto Project Reference Manual">
  8. <link rel="up" href="1.3-recipes.html" title="4.1.2. Recipes">
  9. <link rel="prev" href="1.3-recipes.html" title="4.1.2. Recipes">
  10. <link rel="next" href="migration-1.3-proto=-in-src-uri.html" title="4.1.2.2. proto= in SRC_URI">
  11. </head>
  12. <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="4.1.2.1. Python Function Whitespace">
  13. <div class="titlepage"><div><div><h4 class="title">
  14. <a name="migration-1.3-python-function-whitespace"></a>4.1.2.1. Python Function Whitespace</h4></div></div></div>
  15. <p>
  16. All Python functions must now use four spaces for indentation.
  17. Previously, an inconsistent mix of spaces and tabs existed,
  18. which made extending these functions using
  19. <code class="filename">_append</code> or <code class="filename">_prepend</code>
  20. complicated given that Python treats whitespace as
  21. syntactically significant.
  22. If you are defining or extending any Python functions (e.g.
  23. <code class="filename">populate_packages</code>, <code class="filename">do_unpack</code>,
  24. <code class="filename">do_patch</code> and so forth) in custom recipes
  25. or classes, you need to ensure you are using consistent
  26. four-space indentation.
  27. </p>
  28. </div></body>
  29. </html>