tchan09 opened a new issue, #3145:
URL: https://github.com/apache/fory/issues/3145

   ### Search before asking
   
   - [x] I had searched in the [issues](https://github.com/apache/fory/issues) 
and found no similar issues.
   
   
   ### Version
   
   macos 15.7.3
   python 3.13.7
   pyfory 0.14.1
   
   ### Component(s)
   
   Python
   
   ### Minimal reproduce step
   
   Simplified test cases showing unexpected `TypeError` and `ValueError`s when 
working with lists and sets with `None` elements.
   
   Behaviour is similar even with the `CYTHON` optimization flag set to off.
   
   ```python
   import pyfory
   import pytest
   
   
   def test_pyfory():
       fory = pyfory.Fory(
           xland=False,
           ref=False,
           strict=False,
       )
   
       # List with null
       with pytest.raises(ValueError):
           ref = [None]
           data = fory.dumps(ref)
           fory.loads(data)
   
       # List with nested null
       with pytest.raises(TypeError):
           ref = [5, [5, None]]
           fory.dumps(ref)
   
       # Set with null
       with pytest.raises(ValueError):
           ref = {None}
           data = fory.dumps(ref)
           fory.loads(data)
   
       # Dict with nested null
       with pytest.raises(ValueError):
           ref = {"a": [None]}
           data = fory.dumps(ref)
           fory.loads(data)
   ```
   
   ### What did you expect to see?
   
   Expect native data structures with `None` elements make it back through the 
round trip.
   
   ### What did you see instead?
   
   - `TypeError` requiring an integer during serialisation
   - `ValueError` about unexpected type_id 0 during deserialisation
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to