[IPython-dev] 0.9 beta, anything left?

Fernando Perez fperez.net@gmail....
Thu Aug 14 19:44:47 CDT 2008


On Thu, Aug 14, 2008 at 5:37 PM, Ville M. Vainio <vivainio@gmail.com> wrote:
> On Fri, Aug 15, 2008 at 12:31 AM, Fernando Perez <fperez.net@gmail.com> wrote:
>
>> means special-casing code.  In the new architecture, the magics will
>> be separate objects with a common options parsing machinery that
>> should be uniform, so there's a good chance we'll have to change a bit
>> exactly how this works in the near future.
>
> I don't mind if the behaviour changes, as long as it's as convenient
> (to type) as using --. However, I don't think forcing the magics to go
> through a common parsing machinery is the optimal way to go; we should
> retain the possibility for the current behaviour that allows free form
> data to be passed to magics.
>
> We could also change the character before the release, if the dual
> meaning with long options is a problem. - is something you can type
> without pressing shift on most keyboard layout, so I'd rather leave it
> as it is now.

The issue is one of avoiding special casing.  Magics will certainly
always be able to be given free-form input, but *if* they take
options, then options should be handled as such via optparse or
similar.  Magics behave at the ipython command line much like system
commands, and using -- for both options and arguments would break
option parsing altogether.  I've never seen a single system command
that accepts

foo --option1 --option2 --freeformarguments

because the option parsing machineries (getopt, optparse, whatever) as
far as I know them, always expect to know the list of valid options in
advance. This is why I don't want this hybrid mode, 'cd is special'
case where -- means two different things.

Any suggestions for alternatives?

Cheers,

f


More information about the IPython-dev mailing list