python-zeep icon indicating copy to clipboard operation
python-zeep copied to clipboard

Bug

Open andree0 opened this issue 3 years ago • 1 comments

https://github.com/mvantellingen/python-zeep/blob/2f35b7d29355ba646f5e3c6e9925033d5d6df8bb/src/zeep/xsd/types/simple.py#L52

Type 'copyright', 'credits' or 'license' for more information
IPython 8.3.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: d = {"a": "a", "b": "b"}

In [2]: next(d.keys())
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Input In [2], in <cell line: 1>()
----> 1 next(d.keys())

TypeError: 'dict_keys' object is not an iterator

This line had no right to work in any version of python.

For python 2.7, keys() method returns list and in this case it will give a similar error like TypeError: 'list' object is not an iterator.

andree0 avatar Aug 01 '22 19:08 andree0

The TypeError with which this is associated with seems to want to only care for the first unexpected kwarg considering that in the case of simple types the only kwarg allowed is value=. If that's the case, might as well just throw a iter() call in there to get the desired result. I.e., next(iter(kwargs.keys()))

AndTheDaysGoBy avatar Aug 28 '22 04:08 AndTheDaysGoBy