[IPython-dev] what goes wrong with %%file

Brian Granger ellisonbg at gmail.com
Wed May 15 17:49:13 EDT 2013


OK let's just do the rename and not prompt.

On Wed, May 15, 2013 at 2:44 PM, Fernando Perez <fperez.net at gmail.com> wrote:
> I'm still mildly -1 on prompting on overwrite.  I think of this like
> the default behavior of all unix commands, which is NOT to prompt the
> user for explicit interaction unless manually requests.
>
> But if people feel strongly about it, I can live with it.
>
> f
>
> On Wed, May 15, 2013 at 2:42 PM, Brian Granger <ellisonbg at gmail.com> wrote:
>> I too think that writefile is my favorite so for.  What about
>> prompting on overwrite.  I think Min and I are in favor of that - but
>> I think this new name resolves some of the confusion so I am fine
>> either way.
>>
>> On Wed, May 15, 2013 at 2:38 PM, MinRK <benjaminrk at gmail.com> wrote:
>>>
>>>
>>>
>>> On Wed, May 15, 2013 at 2:31 PM, Fernando Perez <fperez.net at gmail.com>
>>> wrote:
>>>>
>>>> On Tue, May 14, 2013 at 12:35 PM, Brian Granger <ellisonbg at gmail.com>
>>>> wrote:
>>>> > The name "%%file" is conceptually close to what the magic does = it
>>>> > writes/saves/creates a *file*.  What you call the action
>>>> > (write/save/create) is ambiguous, the end result (file) is not.  I
>>>> > don't want to pick a name that emphasizes the ambiguous part of the
>>>> > magic while underplaying the perfectly clear part (file).
>>>>
>>>> While I remember liking %%file when we had the initial naming
>>>> discussions on this for these same reasons, unfortunately we have
>>>> evidence that users do get confused by this.  I've had the same
>>>> question asked during teaching workshops over the last few months.
>>>>
>>>> If it's really confusing lots of users, we should find a way to
>>>> mitigate that instead of having to answer this same question til the
>>>> end of days.
>>>>
>>>> > The name "%%fwrite" requires users to make the non-obvious conceptual
>>>> > jump that "f" = "file".  That is a step back.
>>>>
>>>> Agreed, too cryptic.
>>>>
>>>> > If we do change the name (I am open to it but not thrilled about it) I
>>>> > would prefer something that makes its purpose more obvious:
>>>> >
>>>> > %%writefile
>>>> > %%savefile
>>>> >
>>>> > I also prefer names that order words in a grammatically sensible
>>>> > manner (%%writefile rather than %%filewrite)
>>>>
>>>> Given that in python, the actual lingo uses 'write' (as in open('foo',
>>>> 'w') and f.write() ), I think that writefile is probably my favorite
>>>> choice. Starting with the word file helps a tiny bit
>>>> discoverability/tab completion, but I also agree that a more natural
>>>> reading probably outweighs that.
>>>>
>>>> >From everything we've seen so far, I'm leaning towards `writefile`,
>>>> which should really be completely unambiguous to anyone and should
>>>> clear this source of confusion once and for all.
>>>
>>>
>>> Then I think PR #3317 best reflects consensus - rename to `writefile`,
>>> no change in behavior.
>>>
>>>>
>>>>
>>>> f
>>>> _______________________________________________
>>>> IPython-dev mailing list
>>>> IPython-dev at scipy.org
>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>
>>>
>>>
>>> _______________________________________________
>>> IPython-dev mailing list
>>> IPython-dev at scipy.org
>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>
>>
>>
>>
>> --
>> Brian E. Granger
>> Cal Poly State University, San Luis Obispo
>> bgranger at calpoly.edu and ellisonbg at gmail.com
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev



-- 
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger at calpoly.edu and ellisonbg at gmail.com



More information about the IPython-dev mailing list