diff options
author | Giampaolo Rodola' <g.rodola@gmail.com> | 2014-03-27 13:14:16 (GMT) |
---|---|---|
committer | Giampaolo Rodola' <g.rodola@gmail.com> | 2014-03-27 13:14:16 (GMT) |
commit | 4a692ce5ec362210c61de74979596feadc92d429 (patch) | |
tree | 1ed03caf8122e574b984bb95b92cf282f33de3b2 /Lib/distutils/extension.py | |
parent | d43bf79b5e62d0f5c60145e34876ff34ab6a6665 (diff) | |
download | cpython-4a692ce5ec362210c61de74979596feadc92d429.zip cpython-4a692ce5ec362210c61de74979596feadc92d429.tar.gz cpython-4a692ce5ec362210c61de74979596feadc92d429.tar.bz2 |
Minor cosmetic enhancement to provide a more readable repr()esentation of Extension instances:
- <distutils.extension.Extension at 0x2b2088b79b00>
+ <distutils.extension.Extension('_struct') at 0x2b2088b79b00>
Diffstat (limited to 'Lib/distutils/extension.py')
-rw-r--r-- | Lib/distutils/extension.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/distutils/extension.py b/Lib/distutils/extension.py index a93655a..cc04a18 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, |