Skip to main content
Code Review

Return to Answer

replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

A pythonic idiom is to utilize a list comprehension where possible:

def generateHostList(size):
 return [ generateHost() for _ in range(size) ]

(notice another idiom of using _ for unused).

The generateHost itself may look confusing. The TomBarron TomBarron's solution is better.

A pythonic idiom is to utilize a list comprehension where possible:

def generateHostList(size):
 return [ generateHost() for _ in range(size) ]

(notice another idiom of using _ for unused).

The generateHost itself may look confusing. The TomBarron's solution is better.

A pythonic idiom is to utilize a list comprehension where possible:

def generateHostList(size):
 return [ generateHost() for _ in range(size) ]

(notice another idiom of using _ for unused).

The generateHost itself may look confusing. The TomBarron's solution is better.

Source Link
vnp
  • 58.6k
  • 4
  • 55
  • 144

A pythonic idiom is to utilize a list comprehension where possible:

def generateHostList(size):
 return [ generateHost() for _ in range(size) ]

(notice another idiom of using _ for unused).

The generateHost itself may look confusing. The TomBarron's solution is better.

lang-py

AltStyle によって変換されたページ (->オリジナル) /