Skip to content

Commit ab5baad

Browse files
committed
Introspection
1 parent a8b066b commit ab5baad

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,8 +2206,8 @@ delattr(<object>, '<attr_name>') # Same. Also `del <object>.<attr_name
22062206
<Sig> = inspect.signature(<function>) # Function's Signature object.
22072207
<dict> = <Sig>.parameters # Dict of Parameter objects.
22082208
<memb> = <Param>.kind # Member of ParameterKind enum.
2209-
<obj> = <Param>.default # Default value or <Param>.empty.
2210-
<type> = <Param>.annotation # Type or <Param>.empty.
2209+
<obj> = <Param>.default # Default value or Parameter.empty.
2210+
<type> = <Param>.annotation # Type or Parameter.empty.
22112211
```
22122212

22132213

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,8 +1820,8 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
18201820
<div><h3 id="parameters-1">Parameters</h3><pre><code class="python language-python hljs">&lt;Sig&gt; = inspect.signature(&lt;function&gt;) <span class="hljs-comment"># Function's Signature object.</span>
18211821
&lt;dict&gt; = &lt;Sig&gt;.parameters <span class="hljs-comment"># Dict of Parameter objects.</span>
18221822
&lt;memb&gt; = &lt;Param&gt;.kind <span class="hljs-comment"># Member of ParameterKind enum.</span>
1823-
&lt;obj&gt; = &lt;Param&gt;.default <span class="hljs-comment"># Default value or &lt;Param&gt;.empty.</span>
1824-
&lt;type&gt; = &lt;Param&gt;.annotation <span class="hljs-comment"># Type or &lt;Param&gt;.empty.</span>
1823+
&lt;obj&gt; = &lt;Param&gt;.default <span class="hljs-comment"># Default value or Parameter.empty.</span>
1824+
&lt;type&gt; = &lt;Param&gt;.annotation <span class="hljs-comment"># Type or Parameter.empty.</span>
18251825
</code></pre></div>
18261826

18271827
<div><h2 id="metaprogramming"><a href="#metaprogramming" name="metaprogramming">#</a>Metaprogramming</h2><p><strong>Code that generates code.</strong></p><div><h3 id="type-1">Type</h3><p><strong>Type is the root class. If only passed an object it returns its type (class). Otherwise it creates a new class.</strong></p><pre><code class="python language-python hljs">&lt;class&gt; = type(<span class="hljs-string">'&lt;class_name&gt;'</span>, &lt;tuple_of_parents&gt;, &lt;dict_of_class_attributes&gt;)</code></pre></div></div>

0 commit comments

Comments
 (0)