python_reference icon indicating copy to clipboard operation
python_reference copied to clipboard

Minor typos

Open samparks opened this issue 7 years ago • 5 comments

Added a period to *.*format(tn= ...

samparks avatar Jun 17 '18 21:06 samparks

Thanks! But I see that there are two periods now:

c.execute("UPDATE {tn} SET {cn}='sebastian_r' WHERE {idf}=123456".\
          .format(tn=table_name, idf=id_column, cn=new_column))

Could you please remove the upper one?

rasbt avatar Jun 17 '18 21:06 rasbt

Ah, sorry! I just realized that the places that I thought periods were needed, were just included above instead of on the new line! I'll let you close this unless you'd like for me to change them all for consistency.

samparks avatar Jun 17 '18 22:06 samparks

No worries, and I think it's visually a bit misleading. I think we could leave it as is. It has a bit of those "when you see you old code and cringe" moments ;) I would put the period onto the new line if I wrote it today. Sth like

c.execute("UPDATE {tn} SET {cn}='sebastian_r' WHERE {idf}=123456"
          .format(tn=table_name, idf=id_column, cn=new_column))

(the backslash shouldn't be needed because of the parentheses.)

rasbt avatar Jun 17 '18 22:06 rasbt

👍 sounds good to me. Sorry for the confusion!

samparks avatar Jun 17 '18 22:06 samparks

No worries, I appreciate it that you submitted a PR helping to fix it :)

rasbt avatar Jun 17 '18 22:06 rasbt