-
Notifications
You must be signed in to change notification settings - Fork 773
implement list codec #1084
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
Merged
Merged
implement list codec #1084
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
b500aa1
begin to implement list codec
koubaa f80ae87
add a test
koubaa 765b6a2
improve CanDecode
koubaa 98ce49c
improve list codec
koubaa b827f5a
full set of list codecs
koubaa 224df0e
abandon rank and use three codecs
koubaa 1600fdc
update
koubaa c43446e
respond to PR comments
koubaa 32fa32d
make decoders public
koubaa dfc814b
Make reset public
koubaa f025cd1
add codec tests
koubaa 24d78c3
respond to comments
koubaa ebcfa30
fix brace
koubaa 5cc575d
use unix line endings to avoid large diff
koubaa 17c47a7
fix compiler error
koubaa e8cc3d8
don't rethrow exception
koubaa 080dbc3
cleanup
koubaa 059ab08
fixes
koubaa 432c09e
clean up sequence wrapper
koubaa 3043201
respond to comments
koubaa 57d7779
fix potential double free
koubaa 7fb5915
fix exception
koubaa 085c665
fix all exceptions
koubaa bf2d038
respond to PR feedback
koubaa 07ee9fb
use hasattr("__iter__")
koubaa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
improve list codec
- Loading branch information
commit 98ce49ce66bc3dc987f87b1c9a786dfcf0fa3f77
There are no files selected for viewing
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lostmsu With your idea of multiple codecs I can have a DeepCopyListCodec that takes any ienumerable and converts it by copying to a list. This is what we do right now in master and if we get rid of that implicit conversion the user can just register this codec if that causes an undesirable behavior change for them. @filmor what do you think?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am thinking, that
Python.Runtime.dllshould only contain codecs, that perform lossless conversions, perhaps even enabled by default. E.g. if a type is exactlybuiltins.listit is safe to convert it toIList<T>via some safe wrapper typePythonList<T>, that would contain a reference to the original object. Preferably, when this wrapper is passed back to Python it should either just pass the wrapped object, or behave exactly like a normallistwould.The codecs, that are not lossless, like converting a
builtins.listtoT[], and codecs, that act on relatively uncommon types likeSystem.Urishould go to a separate extra package (created yesterday after seeing your PR): https://github.com/pythonnet/codecsUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lostmsu done. I didn't go as far as to enable by default but that can be done as a followup PR. Please look closely at the test cases as I tried to capture the behavior of each of the three codecs to make sure it meets your expectation.