jacquev6/PyGithub — pull request #192 by akfish (2013-08-21 14:05:54+00:00)
Title: Refactor: add response header field to GithubObject

This pull request is provided as a common base for an alternative solution for conditional request API implementation different from Pull Request #189. Both 2 branches solve the issue of how to introduce **response header** information into ```GithubObjects```, which is currently discarded but necessary for unsupported GitHub API such as [Conditional Request](http://developer.github.com/guides/getting-started/#conditional-requests).

While PR #189 aiming at reducing changes made to the source tree, this branch is more drastic. The signature of constructor is changed to:
```python
def __init__(self, requester, headers, attributes, completed):
# ...
```
Thus enforces initialization with header information and exposes all constructor call for modification. That reduces the chance of introduction bugs from human error such as forget to set header values, comparing to more simple solution such as introducing a simple ```@property```.

All constructor calls are resolved to new signature incrementally and thoroughly tested along the way. The chances of introducing bugs are low (if there are any, it should only affect new features involving response headers).

New testing code for headers are also implemented by hooking up callbacks between ```GithubObject``` and ```Requester``` class. Thus every constructor call can be intercepted for assertion.

Although this should be a more permanent solution, the downside is obvious for the relatively large amount of changes. But I think in the long run it's worth this trouble and would be better to solve any conflicts before introducing new features involving response headers.