What is the proper level of indent for hanging indent with type hinting in python?
<p>What is the proper syntax for a hanging indent for a method with multiple parameters and type hinting?</p>

<p><strong>Align under first parameter</strong></p>

<pre><code>def get_library_book(self,
                     book_id: str,
                     library_id: str
                     )-&gt; Book:
</code></pre>

<p><strong>Indent one level beneath</strong></p>

<pre><code>def get_library_book(
    self, 
    book_id: str, 
    library_id: str
) -&gt; Book:
</code></pre>

<p>PEP8 supports the <em>Indent one level beneath</em> case, but does not specify if <em>Align under first parameter</em> is allowed. It states: </p>

<blockquote>
  <p>When using a hanging indent the following should be considered; there
  should be no arguments on the first line and further indentation
  should be used to clearly distinguish itself as a continuation line.</p>
</blockquote>

<p>Read the previous line of <a href="https://www.python.org/dev/peps/pep-0008/" rel="nofollow">PEP 8</a> more carefully, the part before "or using a hanging indent".</p>

<blockquote>
  <p>Continuation lines should align wrapped elements either vertically using Python's implicit line joining inside parentheses, brackets and braces, or using a hanging indent.</p>
</blockquote>

<p>This is intended to cover the first "yes' example, and your first example above.</p>

<pre><code># Aligned with opening delimiter.
foo = long_function_name(var_one, var_two,
                         var_three, var_four)
</code></pre>

python python-3.x pep8 type-hinting