Filter
Exclude
Time range
-
Near
【Pythonクイズ|中級】 Pythonで静的メソッドを定義するデコレータは? class MyClass: @___ def utility(): pass A. staticmethod B. static C. static_method D. classmethod maruomosquit.com/tools/code-… #プログラミング #Python #クイズ
1
3
141
Accessing static classes dynamically is a bit ass. Like load(script).static_method() works fine. But how do I check it has that method? That it extends a certain type? At the face of it load(script) is foo just checks if the Script Resource extends a class, not the class.
2
437
30 Mar 2021
Replying to @_StanMa
我也没搞明白 最后我经常用的好像只有static_method class_method和property
1
okay so in C we know that these expressions are all equivalent, right? function &(function) &function and it also works for static methods class::static_method &(class::static_method) &class::static_method all equivalent all good? good 1/3
1
1
Replying to @JJJ @Ipstenu
add_action( 'init', __NAMESPACE__ . '\\function ) or add_action( 'init', [ SomeClass::class, 'static_method' ] ) === 👌
3
3
In C , this is valid code: MyClass *lol; // allocated on the stack, in theory the pointer is garbage lol->static_method(); // No problem.
1
1