Movatterモバイル変換


[0]ホーム

URL:


[Python-Dev] FW: PEP 8: exception style

Raymond Hettingerraymond.hettinger at verizon.net
Sat Aug 6 19:10:09 CEST 2005


> PEP 8 doesn't express any preference between the> two forms of raise statements:> raise ValueError, 'blah'> raise ValueError("blah")>> I like the second form better, because if the exception arguments are> long or include string formatting, you don't need to use line> continuation characters because of the containing parens.  Grepping> through the library code, the first form is in the majority, used> roughly 60% of the time.>> Should PEP 8 take a position on this?  If yes, which one?I we had to pick one, I would also choose the second form.  But whybother inflicting our preference on others, both forms are readable sowe won't gain anything by dictating a style.Raymond


More information about the Python-Devmailing list

[8]ページ先頭

©2009-2025 Movatter.jp