regression: event header can't be copied with normal Python syntax.
See original GitHub issueI have been using h11 for a while now. In my code, I made a copy of the headers like this:
headers = ev.headers[:]
That is the normal way to copy a list (headers was a list).
Now, after an update, it does this: ValueError: too many values to unpack (expected 3)
in debugger, the same: 1:Debug:1/2> ev.headers[:] *** ValueError: too many values to unpack (expected 3)
Something changed in the headers
attrbibute. It also does not have a copy
method.
1:Debug:1/2> ev.headers.copy()
*** AttributeError: ‘Headers’ object has no attribute ‘copy’
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Linear Regression in Python - Real Python
In this step-by-step tutorial, you'll get started with linear regression in Python. Linear regression is one of the fundamental statistical ...
Read more >test — Regression tests package for Python — Python 3.11.1 ...
Test for syntax errors in statement by attempting to compile statement. testcase is the unittest instance for the test. errtext is the regular...
Read more >Python Logistic Regression Tutorial with Sklearn & Scikit
In this tutorial, you'll learn about Logistic Regression in Python, its basic properties, and build a machine learning model on a real-world application....
Read more >A Beginner's Guide to Linear Regression in Python with Scikit ...
In this article, we will briefly study what linear regression is and how it can be implemented for both two variables and multiple...
Read more >Chapter 4. Visualization with Matplotlib - O'Reilly
Matplotlib is a multiplatform data visualization library built on NumPy arrays, … ... We won't delve into the details of Gaussian process regression...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Right, so the intent was not to cause any regressions in how we approached #104, but that’s obviously not quite been the case here, since you’ve found a wrinkle.
The change here is that the requirement in #104, of “allow h11 to expose the original header casing” meant that we’ve needed to change headers from a list to a sequence-like interface in the 0.11 release.
There’s two options for us here:
Headers
data structure so that we’re ensuring it has a fully list-like interface, rather than simple a sequence interface.Of those two I’d probably tend towards the first.
From a user POV that’d mean using the following if you want a list-copy of the structure…
Does #125 help this?