From f3157fefbefb6d8d550f4efdd9fe24d8760a58f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Thu, 4 Jul 2019 00:44:53 +0200 Subject: [PATCH] Type --- README.md | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1a2616f..18e8a38 100644 --- a/README.md +++ b/README.md @@ -1745,7 +1745,7 @@ Metaprograming **Code that generates code.** ### Type -**Type is the root class. If only passed the object it returns its type (class). Otherwise it creates a new class.** +**Type is the root class. If only passed an object it returns its type (class). Otherwise it creates a new class.** ```python = type(, , ) diff --git a/index.html b/index.html index ae014a9..0fc2f79 100644 --- a/index.html +++ b/index.html @@ -1507,7 +1507,7 @@ param_names = list(<sig>.parameters.keys())

#Metaprograming

Code that generates code.

Type

-

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

+

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>)
 
>>> Z = type('Z', (), {'a': 'abcde', 'b': 12345})