Age | Commit message (Collapse) | Author |
|
Since Python 3.9, type hinting has become a little less awkward, as for
collection types one doesn't need to import the corresponding
capitalized types (`Dict`, `List`, `Set`, `Tuple`, ...) anymore, but can
use the built-in types directly. [1] [2]
This commit applies the replacement for all Python scripts (i.e. in the
contrib and test folders) for the basic types:
- typing.Dict -> dict
- typing.List -> list
- typing.Set -> set
- typing.Tuple -> tuple
[1] https://docs.python.org/3.9/whatsnew/3.9.html#type-hinting-generics-in-standard-collections
[2] https://peps.python.org/pep-0585/#implementation for a list of type
|
|
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
|
|
|
|
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
|
|
-BEGIN VERIFY SCRIPT-
s() { contrib/devtools/copyright_header.py insert "$1"; }
s build_msvc/bitcoin_config.h
s build_msvc/msvc-autogen.py
s build_msvc/testconsensus/testconsensus.cpp
s contrib/devtools/circular-dependencies.py
s contrib/devtools/gen-manpages.sh
s contrib/filter-lcov.py
s contrib/gitian-build.py
s contrib/install_db4.sh
s src/crypto/sha256_avx2.cpp
s src/crypto/sha256_sse41.cpp
s src/fs.cpp
s src/qt/test/addressbooktests.cpp
s src/qt/test/addressbooktests.h
s src/qt/test/util.cpp
s src/qt/test/util.h
s src/qt/test/wallettests.cpp
s src/qt/test/wallettests.h
s src/test/blockchain_tests.cpp
s test/functional/combine_logs.py
s test/lint/lint-locale-dependence.sh
sed -i '1G' test/lint/lint-shebang.sh
s test/lint/lint-shebang.sh
-END VERIFY SCRIPT-
|
|
This avoids a bogus circular dependency error in the next commit:
interfaces/chain -> interfaces/wallet -> wallet/wallet -> interfaces/chain
Which is incorrect, because interfaces/chain.cpp depends only on the
interfaces/wallet.h file, not the interfaces/wallet.cpp file, and it is
wrong to treat these as a unit. Inside the interfaces directory, .h files
contain abstract class definitions and .cpp files contain implementations of
those classes, so you don't need to link against .cpp files if you're only
using the abstract class definition in the .h file.
An alternative fix might be to rename all the cpp files in the interfaces
directory like: chain.cpp->chain_impl.cpp, node.cpp->node_impl.cpp. But just
getting the linter to treat these files as independent dependencies seemed
like it would allow keeping code organization straightforward and avoiding
the need to rename things.
|
|
|
|
|