Last Comment Bug 732761 - pymake: add __repr__() methods to more data types
: pymake: add __repr__() methods to more data types
Status: RESOLVED FIXED
[pymake]
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: All All
: -- enhancement (vote)
: ---
Assigned To: Michael Haggerty
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-03 22:35 PST by Michael Haggerty
Modified: 2012-03-14 14:29 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch to add __repr__() methods to StringExpansion, Function, VariableRef, and SubstitutionRef (1.58 KB, patch)
2012-03-03 22:35 PST, Michael Haggerty
benjamin: review+
Details | Diff | Splinter Review

Description Michael Haggerty 2012-03-03 22:35:12 PST
Created attachment 602691 [details] [diff] [review]
Patch to add __repr__() methods to StringExpansion, Function, VariableRef, and SubstitutionRef

Several data types do not have __repr__() methods, meaning that when instances are printed, the generic Python implementation is used:

$ cat >Makefile
all:
	@echo $(shell foo)
$ ./mkparse.py Makefile
Parsing Makefile
Rule Exp<Makefile:1:0>('all'): Exp<Makefile:1:0>('')
Command <Expansion with elements: ['@echo ', <pymake.functions.ShellFunction object at 0x9f9834c>]>

So add __repr__() methods to some data classes to provide more informative output.  See attached patch.
Comment 1 Ed Morley [:emorley] 2012-03-04 04:20:48 PST
Comment on attachment 602691 [details] [diff] [review]
Patch to add __repr__() methods to StringExpansion, Function, VariableRef, and SubstitutionRef

Requesting review on behalf of Michael.
Comment 2 Justin Wood (:Callek) 2012-03-11 21:33:46 PDT
c-n, preferrably to the pymake repo in prep of next merge-to-m-c, or at a worse case the b-s branch
Comment 3 Benjamin Smedberg [:bsmedberg] 2012-03-12 05:10:39 PDT
the pymake repo only for now. The imports into the main tree aren't that important.
Comment 4 Ryan VanderMeulen [:RyanVM] 2012-03-14 14:29:21 PDT
http://hg.mozilla.org/users/bsmedberg_mozilla.com/pymake/rev/7a758e6ccf47

Also, please use mq for future patches to make checking in on your behalf easier. Thanks!
https://developer.mozilla.org/en/Mercurial_FAQ#How_can_I_generate_a_patch_for_somebody_else_to_check-in_for_me.3F

Note You need to log in before you can comment on or make changes to this bug.