Re: Coding technique: distinguish using type or abc?

2020-01-09 Thread Marko Rauhamaa
r...@zedat.fu-berlin.de (Stefan Ram): > if type( object ) is list: I would recommend isinstance() because: >>> isinstance(True, int) True >>> type(True) is int False Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Coding technique: distinguish using type or abc?

2020-01-08 Thread Rob Gaddi
On 1/8/20 1:40 PM, DL Neil wrote: Do you prefer to use isinstance() with type() or to refer to collections.abc? This team producing bases statistical analyses for (lesser capable) user-coders to utilise with their own experimental 'control code'; faces situations where a list-parameter is

Coding technique: distinguish using type or abc?

2020-01-08 Thread DL Neil via Python-list
Do you prefer to use isinstance() with type() or to refer to collections.abc? This team producing bases statistical analyses for (lesser capable) user-coders to utilise with their own experimental 'control code'; faces situations where a list-parameter is often only one element long. As is