[Python-ideas] Rosetta Code on Python.org site?

Terry Reedy tjreedy at udel.edu
Fri Oct 16 02:59:41 CEST 2015


On 10/15/2015 8:02 PM, Steven D'Aprano wrote:
> On Thu, Oct 15, 2015 at 02:14:16PM -0700, Chris Barker wrote:
>> On Thu, Oct 15, 2015 at 10:37 AM, Jason Schwerberg <jason at schwerberg.com>
>> wrote:
>>
>>> At risk of completely going off topic from the mission of Python-Ideas,
>>> I'd almost rather see a delineation between Python 2 and Python 3
>>
>>> While there are many ways to make 'good' code, compatible with both Python
>>> 2 and 3, I think that the most terse, efficient code would be better
>>> demonstrated by segregating Python 2.x from Python 3.x.
>>
>> makes sense to me. RC is a wiki, yes? So it looks like this:
>>
>> http://rosettacode.org/wiki/Rosetta_Code:Add_a_Language
>>
>> Is what you need to do...
>>
>> Or would there really  be strong objections from the community to having a
>> Python3 section on the site?

Yes, Python 3 *is* Python. Python has always been dynamic in its 
definition, as well as its execution. 'Python 2' is a sequence of older, 
frozen dialects.  Note that 2.7 code may not run in older versions.  And 
that 2.0 code, for instance, may not work in some 2.x and after.  Python 
2 sections could be added for 2.x-only code, but for most of the tasks, 
solutions that run on 3.x and some subset of 2.x are easily possible. 
When not, the format allow multiple solutions within a language section. 
  For example, FizzBuzz/Python has a both 'print 100 lines' for-loop 
solution and and infinite itertools-based iterator solution.

> I would object to adding Python 3 as a different language. It is not,
> and we should be emphasising the similarities, not the differences.
> Migration to Python 3 is slow enough without giving more ammunition
> ("it's a completely different language, like Perl 6 is to Perl 5") to
> the foot-draggers and haters.

This is why I said the Perl6/5- was not the example to follow.

> Adding Python 3 as a different language would be a strategic error,
> because most code snippets will be identical except for possibly
> print and (raw_)input. That's going to discourage people from adding a
> Python 3 version that is all but identical to the Python 2 version,
> which will increase the perception that nobody is using Python 3.
> ("There are hundreds of Python 2 examples, and only a dozen Python 3
> examples.")
>
> In my opinion, as far as Rosetta Code and similar sites go, all it takes
> to manage the Python 2/3 transition is a single comment at the start of
> the code snippet listing the version(s) targeted. I would consider that
> the minimum needed. Actually providing hybrid 2+3 code, or side-by-side
> versions, would be acceptible too, but that's more work.
>
> I just looked at a small sample of arbitrary examples, and found that
> three out of the four already support Python 3, and the one that didn't
> just needed parens added to print to work.
>
> So I don't think there's actually a problem here that needs fixing.

Except for version labeling and blessing rather than dissing 3.x or 2&3 
solutions.

-- 
Terry Jan Reedy



More information about the Python-ideas mailing list