zeekay / decorum

Python decorator helper library.
MIT License
14 stars 2 forks source link

Fixed doctests around 'assigned' #16

Closed benoitbryon closed 9 years ago

benoitbryon commented 9 years ago

This pull-requests is based on https://github.com/zeekay/decorum/pull/15. In https://github.com/zeekay/decorum/pull/15, "build fails if doctests fail", but doctests actually fail. Here, I added a fix for the doctests, but I'm not sure about the implementation. So you may accept one pull-request but not the other...

Here, I did a change in the behaviour of the assigned feature. Check changes in README:

What's important here is that doctests are fixed!

benoitbryon commented 9 years ago

Hum, I think I will restore the former behaviour and focus on fixing the doctests here... So the behaviour changes are not part of this deal...

benoitbryon commented 9 years ago

Ahaha, functools.WRAPPER_ASSIGNMENTS is not the same in Python2 and Python3... Let's restore ('__name__', '__doc__') and try functools later, in another PR.

benoitbryon commented 9 years ago

Done, doctests pass, with minimal changes of behaviour.

I had to change the README, because print(my_function.__name__) actually outputs None when the name is None.

benoitbryon commented 9 years ago

https://travis-ci.org/zeekay/decorum/jobs/73708648#L165-L171 Looks like it would also fix #8.

zeekay commented 9 years ago

Cool!