From e684214160b206df33bf7c28130c8385535c9606 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 4 Dec 2009 06:35:05 +0100 Subject: [PATCH] list of builtin types that are known to always return an instance of themselves --- Cython/Compiler/Builtin.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Cython/Compiler/Builtin.py b/Cython/Compiler/Builtin.py index 062afb77..37bd6228 100644 --- a/Cython/Compiler/Builtin.py +++ b/Cython/Compiler/Builtin.py @@ -120,6 +120,14 @@ builtin_types_table = [ ("frozenset", "PyFrozenSet_Type", []), ] +types_that_construct_their_instance = ( + # some builtin types do not always return an instance of + # themselves - these do: + 'type', 'bool', 'long', 'float', 'bytes', 'unicode', 'tuple', 'list', + 'dict', 'file', + # 'str', # only in Py3.x + # 'set', 'frozenset' # only in Py2.4+ + ) builtin_structs_table = [ -- 2.26.2