This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sruggier
Recipients Arfrever, arigo, barry, chrish42, eric.snow, eryksun, larry, ncoghlan, ozialien, pitrou, r.david.murray, rhettinger, sruggier
Date 2018-11-22.00:34:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1542846845.09.0.788709270274.issue20309@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-11-22 00:34:05sruggiersetrecipients: + sruggier, barry, arigo, rhettinger, ncoghlan, pitrou, chrish42, larry, Arfrever, r.david.murray, eric.snow, eryksun, ozialien
2018-11-22 00:34:05sruggiersetmessageid: <1542846845.09.0.788709270274.issue20309@psf.upfronthosting.co.za>
2018-11-22 00:34:05sruggierlinkissue20309 messages
2018-11-22 00:34:04sruggiercreate