Git Product home page Git Product logo

Comments (7)

Fatal1ty avatar Fatal1ty commented on May 23, 2024 1

Fixed in 2.2.

from mashumaro.

Fatal1ty avatar Fatal1ty commented on May 23, 2024

Hello @zupo. Thank you for creating this issue.

I came up with the idea of adding empty __slots__ to the parent classes to fix this issue. It seems to work and helps to reduce memory consumption. You can check this branch https://github.com/Fatal1ty/mashumaro/tree/slots.

from mashumaro.

zupo avatar zupo commented on May 23, 2024

Hmm, I tried, but it doesn't seem to work?

from mashumaro.

Fatal1ty avatar Fatal1ty commented on May 23, 2024

Hmm, I tried, but it doesn't seem to work?

I checked your example in the new branch and it fails as it should with AttributeError: 'Bar' object has no attribute 'new_attribute'. The slots test also passes on different Python versions. Can you shed some light on what's not working?

from mashumaro.

zupo avatar zupo commented on May 23, 2024

Gosh, I'm terribly sorry for the noise, it was a mistake on my end. Works as expected!

from mashumaro.

Fatal1ty avatar Fatal1ty commented on May 23, 2024

Gosh, I'm terribly sorry for the noise, it was a mistake on my end. Works as expected!

I don't think it would work without adding __slots__ to DataClassDictMixin and other derived parent classes like DataClassJSONMixin. I was going to release a fix for that but now I'm confused :)

from mashumaro.

zupo avatar zupo commented on May 23, 2024

543356e is definitely needed.

I was not using the correct branch when I first tested (I thought I did) and now I re-checked and works as expected with the slots branch.

I closed the issue by mistake. Getting late, I should go to bed.

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.