[Biopython-dev] Print statements vs functions (Python 2 vs 3)

Peter Cock p.j.a.cock at googlemail.com
Sat Sep 7 18:12:37 UTC 2013


On Sat, Sep 7, 2013 at 2:52 PM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
> On Sat, Sep 7, 2013 at 12:41 PM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
>> Dear Biopythoneers,
>>
>> As you will be aware, with our recent release of Biopython 1.62
>> we now officially support Python 3 for the first time (specifically
>> Python 3.3 - we don't recommend 3.0, 3.1 or 3.2 here), while
>> continuing to support Python 2 as well.
>>
>> Currently all our documentation is written assuming Python 2,
>> but with some small changes most things can be written to
>> work under both variants. The most visible change is how to
>> print things, and that happens a lot in our examples.
>>
>> I would like us to switch to using the Python 3 style print
>> function in our documentation (including the Tutorial and
>> the docstrings embedded in the code as help text).
>>
>> ...
>>
>> Would anyone object to us using the print function style
>> in the Biopython documentation?
>>
>> I'm particularly keen to hear from beginners - as this
>> is potentially confusing.
>>
>> Thanks,
>>
>> Peter.
>
> I tweeted this email,
>
> Biopython Project (@Biopython): Would anyone object to us using
> #Python3 print function style in the #Biopython documentation?
> http://lists.open-bio.org/pipermail/biopython/2013-September/008751.html
> https://twitter.com/Biopython/status/376309705972654080
>
> Two replies already:
>
> Raphael Mattos (@rsmattos): @Biopython I think it's time....
> https://twitter.com/rsmattos/status/376321218456338432
>
> Alec Munro (@alecmunro): @Biopython do it!
> https://twitter.com/alecmunro/status/376341224544038912
>
> Peter

On Sat, Sep 7, 2013 at 5:25 PM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
> On Sat, Sep 7, 2013 at 2:50 PM, Dan Tomso <dtomso at agbiome.com> wrote:
>> Hi, Peter.
>>
>> This sounds OK to me.
>
> Thanks Dan. And another voice of approval on Twitter:
>
> Karin Lagesen (@karinlag): @Biopython @pjacock Go for it!
> https://twitter.com/karinlag/status/376356704080105472

And another positive voice:

Dave Lunt (@davelunt): @Biopython the docs change sounds good, that
very clear explanation you link to should also be somewhere obvious
https://twitter.com/davelunt/status/376405338511384576

Since there has only been positive reaction, I've made a
start at converting the examples in the Tutorial to use the
Python 3 style print function (maintaining full Python 2
compatibility under Python 2.6 and 2.7 via the future
import):

https://github.com/biopython/biopython/commit/34d155a02cbcf7c953fb8238a5412f8c7c0e1cc5
https://github.com/biopython/biopython/commit/74a8b8349b58ae9aa7a727d6e1ab774a4c9008a3

For those curious to see how it looks (but not already
familiar with LaTeX, pdflatex and hevea), you can see
a sneak preview here:

http://biopython.org/DIST/docs/tutorial/Tutorial-dev.html
http://biopython.org/DIST/docs/tutorial/Tutorial-dev.pdf

(Hopefully those links will once again auto-update every
night, something that was working nicely prior to the
server move)

If you spot any typos, please let us know.

Thanks!

Peter



More information about the Biopython-dev mailing list