Potential bug/Unspecified behaviour
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 缺陷
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- python
研究方向
先從 issue 中的 URITemplate.expand 範例和 RFC 6570 的前綴修飾子規則開始,然後比較純量值和清單值的展開方式。該 issue 沒有指定 repository 檔案或現有測試;完成應表示已對清單值達成一致的解釋,並為兩種形式提供回歸涵蓋。
由索引模型根據 Issue 內容生成。
描述
Let's look at a template like this:
http://example.com/dictionary/{term:1}
We have two different behaviours depending upon the value used to expand term.
>>> import uritemplate
>>> u = uritemplate.URITemplate('http://example.com/dictionary/{term:1}')
>>> u.expand(term='foo')
'http://example.com/dictionary/f'
>>> u.expand(term=['foo', 'bar', 'bogus'])
'http://example.com/dictionary/foo,bar,bogus'
A simplified version of this is simply
{term:1}
In other words:
>>> import uritemplate
>>> u = uritemplate.URITemplate('{term:1}')
>>> u.expand(term='foo')
'f'
>>> u.expand(term=['foo', 'bar', 'bogus'])
'foo,bar,bogus'
All versions of uritemplate (and uritemplate.py) exhibit this behaviour and the RFC does not provide clear guidance.
I have not investigated how other implementations in other languages handle this, though. There do not appear to be any examples in the RFC that combine lists with length limitations.
- 主要語言
- Python
- 星號
- 246
- 分支
- 39
- 平均合併
- 13 小時 38 分鐘
- 30 天內合併 PR
- 1
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
python-hyper/uritemplate 的其他 Issue
-
難度 3/5 1-2 天 新手友好度 35/100
python-hyper/uritemplate#51 ·
-
難度 5/5 一週以上 新手友好度 35/100
python-hyper/uritemplate#33 · 9 則留言 ·
-
enhancement
難度 2/5 1-3 小時 新手友好度 45/100
python-hyper/uritemplate#15 ·
-
難度 5/5 一週以上 新手友好度 25/100
python-hyper/uritemplate#6 · 7 則留言 ·
查看 python-hyper/uritemplate 的全部 Issue
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 90/100
-
bug
難度 2/5 1-3 小時 新手友好度 86/100
zostera/django-bootstrap4#894 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
use-agent-os/agent-os#3276 ·
-
難度 2/5 1-3 小時 新手友好度 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
難度 2/5 1-3 小時 新手友好度 88/100
NousResearch/hermes-agent#117848 ·