Oh no, my code is being published ... help!
rm
rmcorrespond at gmail.com
Fri Nov 30 10:30:55 EST 2007
On Nov 30, 10:01 am, Neil Cerutti <horp... at yahoo.com> wrote:
> On 2007-11-30, Eduardo O. Padoan <eduardo.pad... at gmail.com> wrote:
>
>
>
> > On Nov 30, 2007 11:18 AM, Peter Decker <pydec... at gmail.com> wrote:
> >> On Nov 30, 2007 1:19 AM, Tim Roberts <t... at probo.com> wrote:
>
> >> > You also have a couple of instances of:
> >> > print("Error Squeezing %s...")
>
> >> > The parentheses serve no purpose here, and are unidiomatic.
>
> >> I thought that with the eventual dropping of 'print' as a
> >> statement in Python 3, that writing it this way (as if it were
> >> a print function) is preferred, since that will be one fewer
> >> thing to convert.
>
> > No, writing this way will confound the 2to3 tool. Just try for
> > yourself. You would have to write print(something) all the time
> > and disable the fix_print convertion. It is easier and safer to
> > write the common 2.Xish way and let 2to3 do the work.
>
> Output ought be centralized to support maintenance, solving the
> 3.0 compatibility problem as a side-effect.
>
> So the above would be something like:
>
> my_print("Error Squeezing %s..." % the_thingy)
>
> With my_print defined appropriately for the time and place.
>
> Moreover, publishing code today with print(...) will, at best,
> require a needless digression.
>
> --
> Neil Cerutti
Thanks for the great pointers. Exactly what I was looking for. At
least I hope it will save me some embarrassment. :)
More information about the Python-list
mailing list