Minor cosmetic enhancement to provide a more readable repr()esentation of Extension instances:

- <distutils.extension.Extension at 0x2b2088b79b00>
+ <distutils.extension.Extension('_struct') at 0x2b2088b79b00>
This commit is contained in:
Giampaolo Rodola' 2014-03-27 14:14:16 +01:00
parent d43bf79b5e
commit 4a692ce5ec
1 changed files with 8 additions and 0 deletions

View File

@ -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,