Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
map function
#4
Ok, it sounds like you're using Python 3.

Generators are lazy, so until you do something with them they represent more potential than work done. map() and comprehensions (syntactic sugar for maps) are ideal for cases where you're generating iterables of values to be used by something else, if you want side effects (e.g. printing, network stuff, reading / writing files) you should probably use an explicit for loop.
Reply


Messages In This Thread
map function - by landlord1984 - Jan-26-2017, 11:44 PM
RE: map function - by micseydel - Jan-26-2017, 11:55 PM
RE: map function - by landlord1984 - Jan-27-2017, 12:24 AM
RE: map function - by micseydel - Jan-27-2017, 12:39 AM
RE: map function - by landlord1984 - Jan-27-2017, 12:46 AM
RE: map function - by micseydel - Jan-27-2017, 01:05 AM

Forum Jump:

User Panel Messages

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