Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Re: Respect the Built-in Names

momijiame
September 09, 2017

Re: Respect the Built-in Names

PyCon JP 2017 Day2 LT

momijiame

September 09, 2017
Tweet

More Decks by momijiame

Other Decks in Science

Transcript

  1. ͜ͷ LT ͷ͖͔͚ͬ • PyCon JP 2017 Day1 LT •

    @CardinalXaro ͞Μ • λΠτϧ: Respect the Built-in Names • ಺༰: ϏϧτΠϯؔ਺ʹ΋ਓݖ͸͋Δʂ
  2. ࣮ߦྫ • ઌ΄Ͳͷਓݖ৵֐͸શͯ Pylint Ͱर͑Δ $ pylint --disable=R,C overwrite.py No

    config file found, using default configuration ************* Module overwrite W: 1, 0: Redefining built-in 'str' (redefined-builtin) …(লུ)
  3. ࣮͸ରॲํ๏͕ PEP8 ʹʂ single_trailing_underscore_: used by convention to avoid conflicts

    with Python keyword, e.g. Tkinter.Toplevel(master, class_='ClassName') https://www.python.org/dev/peps/pep-0008/
  4. ·ͩ·ͩ͋ΔΑʂ • ศརͳ੩తղੳπʔϧͨͪ • pycodestyle (چ pep8 / ίʔσΟϯάελΠϧνΣοΧ) •

    pydocstyle (چ pep257 / ίʔσΟϯάελΠϧνΣοΧ) • Flake8 (ϓϥΨϒϧͳઃܭͷ൚༻੩తίʔυղੳπʔϧ) • Radon (ίʔυͷෳࡶ౓Λఆྔతʹଌఆ) • autopep8, yapf (ίʔυϑΥʔϚολ)