Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Python has built-in functions for getting strings out of objects, so let's make use of that instead of implementing our own attribute for it. While there, use the same function for
repr()
which makes for nicer playing around in the interactive console.I tried using the
__bytes__()
built-in for the raw bytes as well, but there we hit a snag on python2 vs python3, wherebytes()
does something completely different. I wonder if we makingOid
an iterable would solve this. I've left it out for now.The second commit makes the way to access an object's id be
.id
instead of.oid
. This was following a legacy convention in libgit2, and we now should only use "oid" when referring to the data type, and "id" for the object's attribute. This has shown a couple of places we missed in libgit2 (namelyIndexEntry
andNote
) and I'll be sending a patch there.