dropbox/pyston — pull request #118 by chrisrammy (2014-08-09 00:47:50+00:00)
Title: Added tuple.__new__ accepting an iterable + tests

Support added to initialize a tuple using the tuple type class. Allows
creation specifying positional or using the keyword argument 'sequence'.

Accepts iterables- tested with lists, tuples, sets, dicts and strings

I am concerned about all of the explicit positional and keyword argument checking that is needed to operate identically to CPython. In CPython there is the PyArg_Parse* functions that ease the argument checking. I remember a performance concern with a possible different strategy being investigated (Argument Clinic?). I am wondering if you have any particular abstraction in mind going forward for handling this and other builtin functions (especially that take keyword args).

As for the tests, I have left out lines that deals with sets as initializers. I'm guessing that it is due to the non-deterministic ordering of sets when pickling? I haven't investigated further yet, but aside from the tests (reporting bad output), it appears to work. All of the dicts pass consistently, but they are only one or two elements. I guess there could be a problem with them at some point as well.