From: Giampaolo Rodola' Date: Thu, 27 Mar 2014 13:14:16 +0000 (+0100) Subject: Minor cosmetic enhancement to provide a more readable repr()esentation of Extension... X-Git-Tag: v3.5.0a1~2017 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4a692ce5ec362210c61de74979596feadc92d429;p=python Minor cosmetic enhancement to provide a more readable repr()esentation of Extension instances: - + --- diff --git a/Lib/distutils/extension.py b/Lib/distutils/extension.py index a93655af2c..cc04a18a3a 100644 --- a/Lib/distutils/extension.py +++ b/Lib/distutils/extension.py @@ -131,6 +131,14 @@ class Extension: msg = "Unknown Extension options: %s" % options warnings.warn(msg) + def __repr__(self): + return '<%s.%s(%r) at %#x>' % ( + self.__class__.__module__, + self.__class__.__name__, + self.name, + id(self)) + + def read_setup_file(filename): """Reads a Setup file and returns Extension instances.""" from distutils.sysconfig import (parse_makefile, expand_makefile_vars,