Coder Social home page Coder Social logo

Comments (5)

Fatal1ty avatar Fatal1ty commented on August 19, 2024 2

Oops, I forgot to merge the branch. You can check the version 2.10.1 :)

from mashumaro.

Fatal1ty avatar Fatal1ty commented on August 19, 2024 1

Hi @sizmailov

I see this can't be reproduced on 3.10. But on the previous versions it could be fixed by adding self.cls.__dict__ to typing.get_type_hints here as suggested here https://bugs.python.org/issue42829#msg384423. I'll see if there's any problem with that.

from mashumaro.

sizmailov avatar sizmailov commented on August 19, 2024

I confirm, bug affects 3.8, 3.9, but not 3.10.
Interesting. The bug marked as "won't fix" disappears in next release 🙃

from mashumaro.

Fatal1ty avatar Fatal1ty commented on August 19, 2024

Fixed in 2.10.

from mashumaro.

sizmailov avatar sizmailov commented on August 19, 2024

Fixed in 2.10.

Just tried new release. Looks like the initial snippet still fails with mashumaro==2.10 with python 3.8 and 3.9...

Traceback
Traceback (most recent call last):
  File "/tmp/bug/main.py", line 15, in <module>
    cfg = Root.from_dict({"nested": {"x": 1}})
  File "/tmp/bug/venv-3.9/lib/python3.9/site-packages/mashumaro/serializer/base/dict.py", line 55, in from_dict
    builder.add_from_dict()
  File "/tmp/bug/venv-3.9/lib/python3.9/site-packages/mashumaro/serializer/base/metaprogramming.py", line 375, in add_from_dict
    return self._add_from_dict()
  File "/tmp/bug/venv-3.9/lib/python3.9/site-packages/mashumaro/serializer/base/metaprogramming.py", line 288, in _add_from_dict
    self._add_from_dict_lines()
  File "/tmp/bug/venv-3.9/lib/python3.9/site-packages/mashumaro/serializer/base/metaprogramming.py", line 311, in _add_from_dict_lines
    for fname, ftype in self.field_types.items():
  File "/tmp/bug/venv-3.9/lib/python3.9/site-packages/mashumaro/serializer/base/metaprogramming.py", line 194, in field_types
    return self.__get_field_types()
  File "/tmp/bug/venv-3.9/lib/python3.9/site-packages/mashumaro/serializer/base/metaprogramming.py", line 168, in __get_field_types
    raise UnresolvedTypeReferenceError(self.cls, name) from None
mashumaro.exceptions.UnresolvedTypeReferenceError: Class Root has unresolved type reference Nested in some of its fields

from mashumaro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.