How to declare a module deprecated in python

You want to warn with a DeprecationWarning. Exactly how you call it doesn’t matter that much, but the stdlib has a standard pattern for deprecated modules, like this: # doc string, top-level comments, imports, __all__ = import warnings warnings.warn(“the spam module is deprecated”, DeprecationWarning, stacklevel=2) # normal module code See the 2.7 sets source for … Read more

Replace PHPUnit method `withConsecutive` (abandoned in PHPUnit 10)

I have replaced withConsecutive with the following. $matcher = $this->exactly(2); $this->service ->expects($matcher) ->method(‘functionName’) ->willReturnCallback(function (string $key, string $value) use ($matcher,$expected1, $expected2) { match ($matcher->numberOfInvocations()) { 1 => $this->assertEquals($expected1, $value), 2 => $this->assertEquals($expected2, $value), }; });

How can I deprecate an entire protocol?

I haven’t tried this myself, but I think that the following syntax should work. __attribute__ ((deprecated)) @protocol MyProtocol @end This parallels the syntax for deprecating an entire interface as well as a single method. __attribute__ ((deprecated)) @interface MyClass @end @interface MyClass2 – (void) method __attribute__((deprecated)); @end

What is the reason for `std::result_of` deprecated in C++17?

T.C. already provided the obvious link, but perhaps the most horrific reason bears repeating: result_of involved forming the type F(Arg1, Arg2, …) not for a function of those types returning F but for a function of type F accepting those types. (After all, the return type is the result of, well, result_of, not the input!) … Read more

How can I mark a property as deprecated in delphi?

No, this is not possible. According to the documentation, The ‘hint’ directives platform, deprecated, and library may be appended to any declaration. These directives will produce warnings at compile time. Hint directives can be applied to type declarations, variable declarations, class, interface, and structure declarations, field declarations within classes or records, procedure, function, and method … Read more

tech