Simon Ruggier <simon.rugg...@gmail.com> added the comment:

I hit this problem today with what I'd consider a valid use case: I wanted to 
use a static method as a default argument to a function on the same class. 
Within the class definition context, automatic unwrapping of the staticmethod 
object doesn't occur, so the default value ends up not being callable unless 
the staticmethod object is manually, explicitly unwrapped via __func__.

For those who prefer code to prose, I've attached example Python 2/3 code 
demonstrating what I mean.

The workaround is pretty easy, but on the other hand, it also looks like it 
would also be pretty straightforward to facilitate this use case without 
forcing the author to learn about this distinction and manually unwrap the 
static method, and I think it makes sense to do that.

----------
nosy: +sruggier
Added file: https://bugs.python.org/file47940/example_use_case.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue20309>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to