Skip to content

Conversation

@erikgaas
Copy link
Contributor

@erikgaas erikgaas commented Dec 3, 2025

The current tutorial for ft tags says output can be

class Person:
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def __ft__(self):
        return ['div', [f'{self.name} is {self.age} years old.'], {}]

p = Person('Jonathan', 28)
print(to_xml(Div(p, "more text", cls="container")))

Notice the list being returned by ft. I think this is not valid, so this is fixed in the docs.

Addresses confusion in #775

@erikgaas erikgaas added the documentation Improvements or additions to documentation label Dec 3, 2025
@gitnotebooks
Copy link

gitnotebooks bot commented Dec 3, 2025

Found 1 changed notebook. Review the changes at https://app.gitnotebooks.com/AnswerDotAI/fasthtml/pull/806

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants