3 ms·
But then how does the body of the frobnicate function tell if bar is the default sentinel object() value or not (if bar is ???), without somehow using reflectio
by DonHopkins 4y ago
But then how does the body of the frobnicate function tell if bar is the default sentinel object() value or not (if bar is ???), without somehow using reflection to fish out a reference to the default value of bar from the function definition? Or is there an easy and efficient way to do that? Add yet another optional-but-not-meant-to-be-passed parameter bar_default=bar maybe? Yuck.
- kazinator 4y agoLooks like you can get at that value in frobnicate.__defaults__. Having spread that, I have to go wash my hands now.