@ -54,7 +54,7 @@
< body >
< header >
< aside > April 13 , 2023< / aside >
< aside > May 26 , 2023< / aside >
< a href = "https://gto76.github.io" rel = "author" > Jure Šorn< / a >
< / header >
@ -903,9 +903,10 @@ Z = dataclasses.make_dataclass(<span class="hljs-string">'Z'</span>, [<span clas
< class> = make_dataclass(< span class = "hljs-string" > '< class_name> '< / span > , < coll_of_tuples> )
< tuple> = (< span class = "hljs-string" > '< attr_name> '< / span > , < type> [, < default_value> ])< / code > < / pre > < / div >
< div > < h4 id = "restoftypeannotationscpythoninterpreterignoresthemall" > Rest of type annotations (CPython interpreter ignores them all):< / h4 > < pre > < code class = "python language-python hljs" > < span class = "hljs-function" > < span class = "hljs-keyword" > def< / span > < span class = "hljs-title" > func< / span > < span class = "hljs-params" > (< arg_name> : < type> [= < obj> ])< / span > -> < type> :< / span > ...
< var_name> : typing.List/Set/Iterable/Sequence/Optional[< type> ]
< var_name> : typing.Dict/Tuple/Union[< type> , ...]
< div > < h4 id = "restoftypeannotationscpythoninterpreterignoresthemall" > Rest of type annotations (CPython interpreter ignores them all):< / h4 > < pre > < code class = "python language-python hljs" > < span class = "hljs-keyword" > import< / span > typing < span class = "hljs-keyword" > as< / span > tp, collections.abc < span class = "hljs-keyword" > as< / span > abc
< var_name> : list/set/abc.Iterable/abc.Sequence/tp.Optional[< type> ] [= < obj> ]
< var_name> : dict/tuple/tp.Union[< type> , ...] [= < obj> ]
< span class = "hljs-function" > < span class = "hljs-keyword" > def< / span > < span class = "hljs-title" > func< / span > < span class = "hljs-params" > (< arg_name> : < type> [= < obj> ])< / span > -> < type> :< / span > ...
< / code > < / pre > < / div >
< div > < h3 id = "slots" > Slots< / h3 > < p > < strong > Mechanism that restricts objects to attributes listed in 'slots' and significantly reduces their memory footprint.< / strong > < / p > < pre > < code class = "python language-python hljs" > < span class = "hljs-class" > < span class = "hljs-keyword" > class< / span > < span class = "hljs-title" > MyClassWithSlots< / span > :< / span >
@ -2935,7 +2936,7 @@ $ pyinstaller script.py --add-data '<path>:.' <span class="hljs-comment">
< footer >
< aside > April 13 , 2023< / aside >
< aside > May 26 , 2023< / aside >
< a href = "https://gto76.github.io" rel = "author" > Jure Šorn< / a >
< / footer >