خرید بک لینک

Vote count: 0

In certain styles of python, everything is a generator, e.g. uses yield rather than constructing and retuing a list. If you need to use it as a list, you can just call list(gen).

If I have a list already, what is the cost of calling list(my_list)?

Use: I have a variable that I know has an iterator and might be a list, but I need to use it as a list. Is it better/more pythonic to do my_list = list(my_list) or some other way of checking its list-ness?

If it matters I'm using Python 3.5.

asked 52 secs ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 20 فروردين 1395 ساعت: 22:30

صفحه بندی