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

Paul Moore p.f.moore at gmail.com
Mon Mar 28 13:35:15 EDT 2016


On 28 March 2016 at 17:30, Chris Barker <chris.barker at noaa.gov> wrote:
> and heck, it would even keep the door open to being made a built-in in the
> future.

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?

If it's about interactive use, you have PYTHONSTARTUP, or the config
options of your environment of choice (for example, IPython). 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.

Paul


More information about the Python-ideas mailing list