Skip to content

Instantly share code, notes, and snippets.

View esc's full-sized avatar
:octocat:
doing open source

Emergency Self-Construct esc

:octocat:
doing open source
View GitHub Profile
@esc
esc / reference.md
Created March 29, 2013 13:50 — forked from cholin/pygit2 api reference
pygit2 api reference

Basic API (low-level)

  • public libgit2 structs should be python objects (classes) - Example: git_repository => Repository()
  • nameing convention: strip git_struct_name_* - Example: git_repository_config() => Repository.config()
  • iterations should be implemented as a generator, if this is not possible we need to change libgit2 (other bindings will benefit from this as well)
  • every method should map to one libgit2 function (exceptions are iterations)
  • return values of methods
    • no lists use generators instead
    • no dictionaries use tuples or objects instead
  • no instantiation of objects use strings instead (important for generators)