Keyword arguments are not supported for Events

Aperta
#6,495 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start by locating reflex_base.event.EventCallback.call and the typing used for event callbacks. Reproduce the supplied MyState.do_something example with Python 3.14 and type checking enabled; done means the keyword argument tries is accepted without a type error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug
When yielding a server event with a keyword argument from a server event, the type checker complains with:

Unexpected keyword argument `tries` in function `reflex_base.event.EventCallback.__call__`

To Reproduce
Just paste the code below into your code editor with type checking enabled and note the underlined keyword as shown in the screen shot.

  • Code:
import reflex as rx


class MyState(rx.State):
    @rx.event
    def do_something(self, tries=1):
        # yield something to client
        if tries > 0:
            yield MyState.do_something(tries=tries - 1)

Expected behavior
There should not be any type check errors

Screenshots

Image

Specifics:

  • Python Version: 3.14
  • Reflex Version: 0.9.2
  • OS: Ubuntu
Lingua principale
Python
Stelle
29k
Fork
1.8k
Merge medio
3g 5h
PR unite (30g)
182

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di reflex-dev/reflex

Tutte le issue di reflex-dev/reflex

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.