<div dir="ltr">On 31 July 2013 17:32, Grant Edwards <span dir="ltr"><<a href="mailto:invalid@invalid.invalid" target="_blank">invalid@invalid.invalid</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On 2013-07-31, Tim Chase <<a href="mailto:python.list@tim.thechases.com">python.list@tim.thechases.com</a>> wrote:<br>


</div>> On 2013-07-31 07:16, Joshua Landau wrote:<br>
<div class="im">>> On 30 July 2013 18:52, Grant Edwards wrote:<br>
>>> I also find intializers for tables of data to be much more easily<br>
>>> read and maintained if the columns can be aligned.<br>
>><br>
>> Why do you have tables in your Python code?<br>
<br>
</div>For example: if you're writing an assembler, you usually have a table<br>
of mnemonics/opcodes/instruction-format/addressing-modes.</blockquote><div><br></div><div>Why are you writing an assembler?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class="im">
> I've had occasion to write things like:<br>
><br>
>   for name, value, description in (<br>
>       ("cost", 42, "How much it cost"),<br>
>       ("status", 3141, "Status code from ISO-3.14159"),<br>
>       ...<br>
>       ):<br>
>     do_something(name, value)<br>
>     print(description)<br>
><br>
> I interpret Grant's statement as wanting the "table" to look like<br>
><br>
>   for name, value, description in (<br>
>       ("cost",   42,   "How much it cost"),<br>
>       ("status", 3141, "Status code from ISO-3.14159"),<br>
>       ...<br>
>       ):<br>
>     do_something(name, value)<br>
>     print(description)<br>
<br>
</div>Exactly.  When you have more than about 5 columns and 10 rows, having<br>
things aligned makes it far, far, easier to maintain.</blockquote><div><br></div><div>Honestly I've never had to do something like this. If it got that large, though, I'd factor it out into it's own file and possibly take the advice from others on this list by making it a CSV.</div>

<div><br></div><div>That said for someone like me the very tiny frequency I'd have to do such a thing would pale in comparison to the other costs and benefits of variable with fonts.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class="im">
> which does give some modest readability benefits, but at a creation<br>
> cost I personally am unwilling to pay.<br>
<br>
</div>It only gets typed once, it gets read hundreds or thousands of times.<br>
Optimize the common case.<br></blockquote><div><br></div><div>PEP 8, under the things-not-to-do section, says:</div><div><br></div>    · More than one space around an assignment (or other) operator to align it with another.<br>

<br>    Yes:<br>        x = 1<br>        y = 2<br>        long_variable = 3<br><br>    No:<br>        x             = 1<br>        y             = 2<br>        long_variable = 3<div> </div><div>I assume similar applies here. Obviously PEP 8 isn't a rule but it's a rough stab at general consensus.</div>

</div></div></div>