This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # a.py | |
| class A: | |
| def __init__(self, foo): | |
| self.foo = foo | |
| # a.pyi | |
| from .b import B | |
| class A: | |
| foo: B | |
| def __init__(self, foo: B): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.function.Function; | |
| import java.util.List; | |
| class HowMany { | |
| private String convert(String a) { | |
| return "foo" + a; | |
| } | |
| private void test(Function<String, String> func) { | |
| System.out.println(func.apply("test")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/bash | |
| # Works in bash and zsh. | |
| codeerr() { | |
| # Echo an error to stderr, but output a code to stdout. | |
| # Allows return $(codeerr 1 some message) | |
| local num=$1 | |
| shift | |
| >&2 echo "$@" | |
| echo "$num" |