Closed jorio closed 5 months ago
Following up on #1251: C functions in _pygit2 now return actual Python enums instead of ints.
For example, Repository.status() would previously return simple ints. Now it returns FileStatus which transparently demotes to ints for legacy code:
>>> repo.status() {'file1.txt': <FileStatus.CONFLICTED: 32768>, 'file2.txt': <FileStatus.INDEX_MODIFIED|WT_MODIFIED: 258>}
Implementation details: References to the enums are cached via cache_modules so that lookups are faster. The references are decref'd in free_module (new module destructor function)
cache_modules
free_module
Affected functions:
Following up on #1251: C functions in _pygit2 now return actual Python enums instead of ints.
For example, Repository.status() would previously return simple ints. Now it returns FileStatus which transparently demotes to ints for legacy code:
Implementation details: References to the enums are cached via
cache_modules
so that lookups are faster. The references are decref'd infree_module
(new module destructor function)Affected functions: