Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Tuples passed in parameters are not accessible by name

Đang mở
#151 13 bình luận 0 reaction 1 người được giao Xem trên GitHub

@wenhzha đang làm issue này rồi.

Từ ngày 10/11/2020.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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}!"
Ngôn ngữ chính
Python
Star
157
Fork
71
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Azure/azure-functions-durable-python

Tất cả issue của Azure/azure-functions-durable-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.