Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Tuples passed in parameters are not accessible by name

Aperta
#151 13 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@wenhzha ci sta già lavorando.

Dal 10/11/2020.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Enhancement P2

Please note that I may be doing things wrong but it seems like it should work. I had to use deconstruction to make it work.

Please see the commented code in the activity section.

To reproduce

Azure Functions Core Tools (3.0.2630 Commit hash: beec61496e1c5de8aa4ba38d1884f7b48233a7ab)
Function Runtime Version: 3.0.13901.0
Python 3.7.7
Orchestrator
from collections import namedtuple
import azure.functions as func
import azure.durable_functions as df


def orchestrator_function(context: df.DurableOrchestrationContext):
    Location = namedtuple('Location', ['city', 'state'])
    location = Location(city='Seattle', state= 'WA')

    weather = yield context.call_activity("GetWeather", location)

    # ...

Activity
import logging
from collections import namedtuple

Location = namedtuple('Location', ['city', 'state'])

def main(location: Location) -> str:
    city, state = location
    # THIS DOESN'T WORK 👇
    # return f"Hello {location.city}, {location.state}!"  
    return f"Hello {city}, {state}!"
Lingua principale
Python
Stelle
157
Fork
70
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 Azure/azure-functions-durable-python

Tutte le issue di Azure/azure-functions-durable-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.