mvantellingen / python-zeep

A Python SOAP client
http://docs.python-zeep.org
Other
1.87k stars 579 forks source link

Bug #1325

Open andree0 opened 1 year ago

andree0 commented 1 year ago

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.

AndTheDaysGoBy commented 1 year ago

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()))