Coder Social home page Coder Social logo

Comments (2)

stefanhoelzl avatar stefanhoelzl commented on June 27, 2024 1

Thanks for reporting!

TL;DR
get the latest changes on master and make a slight modification to your code

from vue import *

class Parent(VueComponent):
    @computed
    def my_computed(self):
        return 'Parent'

    template = '<div>Hello {{my_computed}}!</div>'

class Child(Parent):
    @computed
    def my_computed(self):
        value = super().my_computed()
        return f'Child of {value}'

Child('#app')

There are actually two bugs when using f'Child of {super().my_computed()}'

  1. the one you discovered with the __mro__ one you discovered
    This seems to be a bug in the brython version used by vue.py (3.8.9), when using super() within a f-string.
class A:
    def foo(self):
       return "A"

class B(A):
    def foo(self):
        return f"{super().foo()}"

raises the same exception
but this works

class A:
    def foo(self):
       return "A"

class B(A):
    def foo(self):
        value = super().foo()
        return f"{value}"

the latest brython version 3.11.1 seems to have fixed this. But there is some work required on vue.py to be able to bump the version.

  1. computed properties where not callable in vue.py
    for this issue I just push a fix to master

from vue.py.

meteozond avatar meteozond commented on June 27, 2024

Wow this is super!

from vue.py.

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.