Python Forum
Trying to understand how isinstance(values, collections.Iterable) work.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to understand how isinstance(values, collections.Iterable) work.
#8
(Aug-10-2021, 06:46 AM)Gribouillis Wrote: I don't see what is so modern with the idea of checking the arguments type at runtime. It looks like an extreme regression to me. Duck typing is what made Python successful. Otherwise we can use a statically typed language. It will have better performance.
Yes i do agree,have not used type hint so much myself and that strongtyping do check at runtime is kind of interesting (maybe useful in some cases).
Lager companies that use Python so is now type annotations heavily used.
Our journey to type checking 4 million lines of Python

I did not like type annotations much at first,but i see that in some cases that it can help readability and documentation of code
In newer Python version eg 3.9 they clean it more up PEP 585.
Reply


Messages In This Thread
RE: Trying to understand how isinstance(values, collections.Iterable) work. - by snippsat - Aug-10-2021, 08:10 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question how to solve `'TypeError: 'int' object is not iterable`? netanelst 2 1,620 May-24-2022, 12:03 PM
Last Post: deanhystad
  cs.collections error DaveG 7 1,797 Apr-06-2022, 04:18 PM
Last Post: Larz60+
  basic question isinstance tames 5 2,873 Nov-23-2020, 07:20 AM
Last Post: tames
  Cannot unpack non-iterable NoneType object, i would like to ask for help on this. Jadiac 3 8,968 Oct-18-2020, 02:11 PM
Last Post: Jadiac
  subprogram issues: cannot unpack non-iterable function object error djwilson0495 13 6,060 Aug-20-2020, 05:53 PM
Last Post: deanhystad
  Help with isinstance command (very simple code) Laplace12 2 2,031 Jul-30-2020, 05:26 AM
Last Post: Laplace12
  isinstance() always return true for object type check Yoki91 2 2,602 Jul-22-2020, 06:52 PM
Last Post: Yoki91
  AttributeError: 'collections.OrderedDict' object has no attribute 'value_counts Kristenl2784 4 7,403 Jul-17-2020, 01:50 AM
Last Post: palladium
  collections.OrderedDict Bert123456 2 1,809 Jul-09-2020, 08:51 PM
Last Post: Bert123456
  Why the result of "extended iterable unpacking" with set() is unpredictable? zohanlin 2 2,106 Jun-29-2020, 10:30 AM
Last Post: zohanlin

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020