Python Forum
DeprecationWarning Any Fix for this
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DeprecationWarning Any Fix for this
#1
from collections import Iterable
def flatten(items, ignore_types=(str, bytes)):
    for x in items:
        if isinstance(x, Iterable) and not isinstance(x, ignore_types):
            yield from flatten(x)
        else:
            yield x
    items = [1, 2, [3, 4, [5, 6], 7], 8]
    for x in flatten(items):
        print(x)
Error Respond code
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Iterable
Reply


Messages In This Thread
DeprecationWarning Any Fix for this - by Calli - Apr-24-2020, 07:27 PM
RE: DeprecationWarning Any Fix for this - by buran - Apr-24-2020, 07:29 PM
RE: DeprecationWarning Any Fix for this - by Calli - Apr-24-2020, 07:30 PM

Forum Jump:

User Panel Messages

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