[Python-ideas] `to_file()` method for strings

Chris Barker - NOAA Federal chris.barker at noaa.gov
Mon Mar 28 20:27:57 EDT 2016


> What's the huge advantage of being a builtin? Sure, I can understand
> the benefit of wanting it in the stdlib over being a 3rd party
> dependency or a "simple recipe you can add to your own code"[1], but
> what is the huge deal about avoiding an import?

Well, I'm not the OP here, but:

> If it's about interactive use, you have PYTHONSTARTUP, or the config
> options of your environment of choice (for example, IPython).

Well, I find I want to cut and paste code to-from interactive
environment enough, and use enough different systems, that I never
customize my environment like that.

> For
> scripts, a one-line import is certainly not something to worry about.
> And for teaching, you can't get very far in Python without knowing
> about imports, so it's not like you're needing an advanced concept
> here.

No a very big deal, no -- but neither is using with ....

:-)

So forget I said that, and let's consider putting it in the io module.

-CHB



>
> Paul


More information about the Python-ideas mailing list