-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replaced class CppDict with new class SDict, updated with latest changes from python_project_template #30
Replaced class CppDict with new class SDict, updated with latest changes from python_project_template #30
Conversation
…ject_template (files in root folder, .github, .vscode, as well as selected files in docs and tests)
…n methods that return self.
…ned out not to be a solid solution. (This basically reverts commit 081992)
…ocumenting what the differences between these two methods are.
…`__ror__()`) and inner-or (`__ior__()`) special methods.
…__ror__()`) and inner-or (`__ior__()`) special methods to update also attributes.
…tance, i.e. the instance of the argument passed in, not a copy.
I have some comments | questions for better understanding the whole thing. |
Another comment; in types.py is the type TKye and TValue to type Any. Isn't it simply taking Any as type and simply doing nothing? |
Hi Frank, @frl000 good comments and questions. Probably best to have a chat :-) However, I try to give a first response in written, following the three aspects you raised: (1) Backward compatibility (2) Naming of generic type variables for the key and value type in Prompt: Response:
In this example, So, based on that, how about changing (3) Type aliases But, if we are honest, we currently would need to limit key type, for instance, to Well, that was the idea. When I did so for a quick test, though, mypy and pyright immmediatly raised so many issues that I turned types back to |
…bers was generated twice and added extension to support Markdown-based diagrams created with Mermaid.
…hon_project_template # Conflicts: # src/dictIO/cli/dictParser.py # src/dictIO/cppDict.py # src/dictIO/dictParser.py # src/dictIO/dictReader.py # src/dictIO/formatter.py # src/dictIO/parser.py # src/dictIO/utils/counter.py # src/dictIO/utils/strings.py # tests/test_dictReader.py # tests/test_dictWriter.py # tests/test_formatter.py # tests/test_parser.py # tests/utils/test_path.py
…(non-reusable) workflow. Remove the two reusable workflows _publish_package.yml and _publish_package_test.yml. Background for this change is a limitation recently introduced on pypi, which does not allow anylonger to run the GitHub action 'pypa/gh-action-pypi-publish' from a reusable workflow. The code hence needed to be moved upwards, from the reusable workflow _publish_package.yml into the (non-reusable) workflow publish_release.yml See https://github.com/marketplace/actions/pypi-publish -> Note under "Trusted Publishing"
…r` to `NativeParser`
Breaking change
CppDict
in moduledictIO.cppDict
has been replaced with the classSDict[_KT, _VT]
in moduledictIO.dict
.In order to maintain backward compatibility, a thin wrapper class named
CppDict
is kept in version ~0.4.0.It is marked as deprecated, though, and will be removed with release 0.5.0.
CppDict
inherited fromUserDict
,SDict
inherits directly from Python'sdict
class,allowing to use it in any context where a
dict
or any otherMutableMapping
is expected.SDict
is generic. Static type checkers will hence require type arguments whenSDict
is used in type hints.Where you could write
my_dict: CppDict = CppDict()
, you will now need to specify the type arguments, e.g.my_dict: SDict[str, Any] = SDict()
. With this change, type hinting is in line with how type hinting of Python's builtindict
works, and offers more control in static type checking.Changed
pip
/tox
touv
as package manageruv
as package manager.Added
dump()
andload()
toSDict
mypy
as static type checker (in addition topyright
)GitHub workflows
uv
as package managerDependencies