Transitioning away from PEP8

22 views
Skip to first unread message

Aidan Gomez

unread,
Jul 3, 2018, 3:14:35 AM7/3/18
to cleverhans dev
Hello all,

I just wanted to know what you thought about moving away from the PEP8 standard and moving towards something a little less strict and more familiar to TensorFlow/PyTorch people?

My favourite is the Google python style guide: https://github.com/google/styleguide/blob/gh-pages/pyguide.md and there are loads of auto-formatters we can get people to use. Since we're under tensorflow/ these days it also makes sense to match their formatting which is the Google style.

Let me know if this is something we could support and I can make the changes necessary :)

Aidan

Ian Goodfellow

unread,
Jul 3, 2018, 12:44:21 PM7/3/18
to aidan....@gmail.com, cleverhans dev
The TensorFlow style guide ( https://www.tensorflow.org/community/style_guide ) is actually "follow PEP8 Python style guide, except for using 2 spaces".

Are there other things you'd like to change apart from the number of spaces?

--
You received this message because you are subscribed to the Google Groups "cleverhans dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cleverhans-de...@googlegroups.com.
To post to this group, send email to cleverh...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cleverhans-dev/560f79e9-a241-42c4-9eaa-d7ebdaa60b12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aidan Gomez

unread,
Jul 3, 2018, 12:51:58 PM7/3/18
to Ian Goodfellow, cleverhans dev
Maybe I didn’t mean move away from PEP8, and instead meant use Google/Tensorflow documentation style: https://www.tensorflow.org/community/documentation and use two spaces instead of four.

That’s what I meant by the something more familiar to Tensorflow and PyTorch users. Although PyTorch uses four spaces… which I’m personally really not a fan of. It seems completely vacuous that less line continuations is a better thing, not to mention the visual ambiguity of line continuations from real indentation (see: https://github.com/pytorch/pytorch/blob/master/torch/tensor.py#L60).

Aidan

Nicolas Papernot

unread,
Jul 3, 2018, 1:04:09 PM7/3/18
to Aidan Gomez, Ian Goodfellow, cleverhans dev
Transitioning to 2 spaces instead of 4 would be reasonable to be consistent with the overall TensorFlow style guide and code ecosystem.

Reply all
Reply to author
Forward
0 new messages