On Sun, Oct 1, 2017 at 5:12 AM, Stefan Ram <[email protected]> wrote:
> I would like to write source code similar to:
>
> country( 'USA' )
> state( 'Alabama' )
> town( 'Abbeville' )
> town( 'Addison' )
> state( 'Arizona' )
> town( 'Apache Junction' )
> town( 'Avondale )
> town( 'Benson' )
>
> using "semantic indentation".
>
> It seems I can't do this with Python.
>
> Is there any workaround?
If the indentation has semantic significance, you shouldn't need to
say "country" or "state" or "town". I suggest this format:
USA:
Alabama:
Abbeville
Addison
Arizona:
Apache Junction
Avondale
Benson
and then, as Paul suggested, write a simple parser to read it.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list