Patches item #1678060, was opened at 2007-03-10 16:34 Message generated for change (Comment added) made by jimjjewett You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1678060&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: Python 3000 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Tony Lownds (tonylownds) Assigned to: Brett Cannon (bcannon) Summary: Removal of Tuple Parameter Unpacking [PEP3113] Initial Comment: Remove tuple parameter unpacking. The Grammar is now: typedargslist: ((tfpdef ['=' test] ',')* ('*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef) | tfpdef ['=' test] (',' tfpdef ['=' test])* [',']) tfpdef: NAME [':' test] varargslist: ((vfpdef ['=' test] ',')* ('*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef) | vfpdef ['=' test] (',' vfpdef ['=' test])* [',']) vfpdef: NAME Tuple parameters are removed from Lib/. ---------------------------------------------------------------------- Comment By: Jim Jewett (jimjjewett) Date: 2007-03-22 08:57 Message: Logged In: YES user_id=764593 Originator: NO On the reprs, is there a reason to call repr instead of using %r? For example, the Floordiv repr changed to: "FloorDiv(%s, %s)" % (repr(self.left), repr(self.right)) Why not "FloorDiv(%r, %r)" % (self.left, self.right) or even, (assuming PEP 3101 with locals,) "FloorDiv({self.left:r}, {self.right:r})".format() ---------------------------------------------------------------------- Comment By: Jim Jewett (jimjjewett) Date: 2007-03-22 08:47 Message: Logged In: YES user_id=764593 Originator: NO Not sure if any of these are really problems, and it looks like Tony already looked them over before submitting, but still worth mentioning... (1) This does more than take out tuples, though the other changes do also look like things that ought to change for py3k. (2) I was amused by the name "stuff", but I couldn't think of a better name for that particular grouping. (suffix, mode, type) (3) There are some signature changes, where the unpacking is now done by the caller, such as class LeftShift(Node): - def __init__(self, (left, right), lineno=None): + def __init__(self, left, right, lineno=None): (4) The pdb change marks could be shortened a bit. That shouldn't matter for patching, but I'll post it here since it helped me. - def user_exception(self, frame, (exc_type, exc_value, exc_traceback)): + def user_exception(self, frame, exc_info): """This function is called if an exception occurs, but only if we are to stop at or just below this level.""" + (exc_type, exc_value, exc_traceback) = exc_info frame.f_locals['__exception__'] = exc_type, exc_value - if type(exc_type) == type(''): - exc_type_name = exc_type - else: exc_type_name = exc_type.__name__ + exc_type_name = exc_type.__name__ print(exc_type_name + ':', _saferepr(exc_value), file=self.stdout) self.interaction(frame, exc_traceback) ---------------------------------------------------------------------- Comment By: Tony Lownds (tonylownds) Date: 2007-03-12 11:07 Message: Logged In: YES user_id=24100 Originator: YES I found some more code to be removed + a docstring fix in inspect.py. getfullargspec's docstring lists the wrong order for return values. This patch combined the refmanual patch, previous simplified args patch, and 2to3 changes on some doc building tools. File Added: simplified-args.patch ---------------------------------------------------------------------- Comment By: Tony Lownds (tonylownds) Date: 2007-03-11 18:34 Message: Logged In: YES user_id=24100 Originator: YES File Added: refmanual.patch ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1678060&group_id=5470 _______________________________________________ Patches mailing list Patches@python.org http://mail.python.org/mailman/listinfo/patches