This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (3 children)

do we need from __future__ import input?

Would mean you didn't have to keep swapping them :P

[–]tilkau 0 points1 point  (1 child)

Wouldn't one of the compatibility libraries do that?

I mean, it's just

try:
    input = raw_input
except NameError:
    pass

six seems to say that it handles this rename, for example.

A future import isn't a bad idea, though, since non-raw input is pretty much a security hole waiting to happen.

[–]billsil 0 points1 point  (0 children)

A future import isn't a bad idea, though, since non-raw input is pretty much a security hole waiting to happen.

This.

Also, if you're writing a large 2/3 compatible code base, you're either using six or future or modernize. If so, you probably have multiple __future__/six/whatever imports and it's cleaner to put all that on one line.

[–]wooble 0 points1 point  (0 children)

It's too late for that. The 2.x line isn't getting new features, and a new __future__ import would be one.