Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Huh, well I hadn't actually thought of that... Certainly an interesting little bit of trivia xD
-
SOlson597yCould maybe see that being useful for tracking the number of times a function is called maybe? Definitely an unexpected behavior.
-
@Cyanide closest you can get is adding a method to the functions protype and then creating an instance of the function I believe. You can't call a functions methods unless you have an instance of it.
-
aritzh7537yWell, if the indentation is right, you'd have to call some_function() first, for the member to be defined.
-
@SOlson thinking about it some more, this is probably how the unittest.mock objects work...
Related Rants
-
rvnx25"Oh haha I found out why your PC isn't turning on, you forgot to turn on the power switch!" *flick*
-
GoogleMac4Me: "So, to recap.. I'll be creating an integration between your site and [some software]. It will require [li...
-
Pointer2You always see fail2ban message: There has been n failed attempts" But... Have you ever thought about how ma...
TIL that Python's "everything is an object" mentality allows you to do
def some_function():
some_function.variable = "abc"
print(some_function.variable)
> abc
rant
the horror
trip the noob