vwbusguy,
@vwbusguy@mastodon.online avatar

The library is over here making lists not iterable and harming my sanity this morning.

TypeError: 'V1NamespaceList' object is not iterable

vwbusguy,
@vwbusguy@mastodon.online avatar

And yes, they named an object as List, so it's technically not a list type, but you can get the list with .items, which is unnecessarily pedantic since they could have provided an iter which does exactly this when you try to iterate it.

diji,
@diji@mastodon.social avatar

@vwbusguy Well, that’s not very pythonic…

trouble,
@trouble@masto.ai avatar

@diji @vwbusguy

Agreed, but that code is also, um, 8 years old? https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/V1NamespaceList.md and https://github.com/kubernetes-client/python/blame/94e42113a1fe5c580917decacdde879eab7406b3/kubernetes/client/models/v1_namespace_list.py#L21

class V1NamespaceList(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech

Do not edit the class manually.
"""

That header implies it's "caused" by reliance on OpenAPI.

vwbusguy,
@vwbusguy@mastodon.online avatar

@trouble @diji It's a shame they can't also auto-generate an iter from openapi.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • Kubernetes
  • InstantRegret
  • ngwrru68w68
  • everett
  • mdbf
  • modclub
  • rosin
  • khanakhh
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • Youngstown
  • GTA5RPClips
  • slotface
  • kavyap
  • JUstTest
  • ethstaker
  • osvaldo12
  • normalnudes
  • tacticalgear
  • cisconetworking
  • cubers
  • Durango
  • Leos
  • anitta
  • tester
  • megavids
  • provamag3
  • lostlight
  • All magazines