FIFE forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

FIFE 0.4.0 has been released on 15th of January, 2017!

Author Topic: Python coding standards  (Read 5226 times)

CheeseSucker

  • Developer
  • Newbie
  • *
  • Posts: 26
  • FIFE programmer
    • View Profile
Python coding standards
« on: September 20, 2009, 05:02:44 pm »

This is just a post to notify you that we now have a coding standard for our python assets:
https://github.com/fifengine/fifengine/wiki/Python-coding-standards

If you have comments on the article, post them here.
« Last Edit: March 14, 2016, 10:24:32 am by prock »
Logged

ShaXbee

  • Newbie
  • Posts: 5
    • View Profile
Re: Python coding standards
« Reply #1 on: October 20, 2009, 09:24:59 am »

Hello,

I'm lurking around Framework development forum for some time and just want to ask if i can adapt python coding guidelines for project I'm working in?
Logged

mvBarracuda

  • Administrator
  • Sr. Member
  • *
  • Posts: 411
    • View Profile
Re: Python coding standards
« Reply #2 on: October 20, 2009, 09:41:06 am »

Sure go ahead, I don't think that anyone would be angry about that. If you're posting them at some public place (wiki, forums, etc.) it would be great if you could add a little note. Something like "these coding standards have been inspired by <link to our python coding standards>".
Logged

ShaXbee

  • Newbie
  • Posts: 5
    • View Profile
Re: Python coding standards
« Reply #3 on: October 21, 2009, 07:20:46 am »

Thanks. Of course i'll add note about source.

Edit:
Article is here: http://trac.eu07.pl/eu07-spt/wiki/PythonCodingGuidelines

Few possible problems in coding guidelines:
  • What about maximal line length? Do you limit it to 79 characters same as in PEP8?
  • Your coding guidelines says little about unit tests - how they are implemented? In seperate files or in same file?
  • What documentation generator is used? Tags in docstrings aren't explained.
« Last Edit: October 21, 2009, 07:50:14 am by ShaXbee »
Logged

phoku

  • Developer
  • Full Member
  • *
  • Posts: 102
    • View Profile
    • IZ dev blog
Re: Python coding standards
« Reply #4 on: October 21, 2009, 10:32:13 am »

Hi there,

I honestly think you should head over to the PEP008 first.
That's where most of our guidelines were inspired from.

Regarding UnitTests, we have a bit of a problem there as the code in question (mostly) is ...

  • The Editor
  • The Gui Library

... and those are difficult to test.

As a documentation generator we use epydoc, another great tool is sphinx.
Django uses it - and well it's docs are awesome(1).

Good luck with your project :-)

-phoku

(1) http://docs.djangoproject.com/en/dev/

Logged

ShaXbee

  • Newbie
  • Posts: 5
    • View Profile
Re: Python coding standards
« Reply #5 on: October 22, 2009, 07:29:20 am »

Hello phoku,

I honestly think you should head over to the PEP008 first.
That's where most of our guidelines were inspired from.
I know the PEP8, but were to lazy to shorten it to one document :)

As a documentation generator we use epydoc, another great tool is sphinx.
Django uses it - and well it's docs are awesome(1).
It's hard to disagree that sphinx documentation is great but it requires learning Yet Another Markup Languge (RST in this case) apart from Wiki syntax :) Because ATM most of interfaces are written in C++ we use doxygen. I dont have idea how to document Python wrappers, maybe you can share some thoughts?

Good luck with your project :-)
Thanks, FIFE and PyChan are success stories and encourage me to work on project ;) I hope that i'll find some time for FIFE development too in near future.
Logged

prock

  • Developer
  • Full Member
  • *
  • Posts: 236
    • View Profile
Re: Python coding standards
« Reply #6 on: October 22, 2009, 07:45:59 pm »

Thanks, FIFE and PyChan are success stories and encourage me to work on project ;) I hope that i'll find some time for FIFE development too in near future.

I hope so also  ;D
Logged

prock

  • Developer
  • Full Member
  • *
  • Posts: 236
    • View Profile
Re: Python coding standards
« Reply #8 on: March 14, 2016, 10:25:11 am »

Thanks for the pointer emilhem.  Link has been updated.
Logged