diff --git a/README.md b/README.md index 421bd22..0d83af7 100644 --- a/README.md +++ b/README.md @@ -2126,7 +2126,7 @@ Metaprograming **Type is the root class. If only passed an object it returns its type (class). Otherwise it creates a new class.** ```python - = type(, , ) + = type('', , ) ``` ```python diff --git a/index.html b/index.html index 412347e..37a16fd 100644 --- a/index.html +++ b/index.html @@ -1852,7 +1852,7 @@ no_of_params = len(<sig>.parameters) param_names = list(<sig>.parameters.keys()) -

#Metaprograming

Code that generates code.

Type

Type is the root class. If only passed an object it returns its type (class). Otherwise it creates a new class.

<class> = type(<class_name>, <parents_tuple>, <attributes_dict>)
+

#Metaprograming

Code that generates code.

Type

Type is the root class. If only passed an object it returns its type (class). Otherwise it creates a new class.

<class> = type('<class_name>', <parents_tuple>, <attributes_dict>)
diff --git a/parse.js b/parse.js index 04bb459..47f7954 100755 --- a/parse.js +++ b/parse.js @@ -55,7 +55,7 @@ const LRU_CACHE = ' return n if n < 2 else fib(n-2) + fib(n-1)\n'; const TYPE = - '<class> = type(<class_name>, <parents_tuple>, <attributes_dict>)'; + '<class> = type(\'<class_name>\', <parents_tuple>, <attributes_dict>)'; const DATACLASS = 'from dataclasses import make_dataclass\n' + @@ -154,7 +154,7 @@ function fixHighlights() { $(`code:contains(shutil.copy)`).html(SHUTIL_COPY); $(`code:contains(ValueError: malformed node)`).html(EVAL); $(`code:contains(@lru_cache(maxsize=None))`).html(LRU_CACHE); - $(`code:contains(, , )`).html(TYPE); + $(`code:contains(\'\', , )`).html(TYPE); $(`code:contains(make_dataclass(\'\')`).html(DATACLASS); }