Ruby 2.0.0 released
Posted Feb 24, 2013 16:47 UTC (Sun) by
tnoo (subscriber, #20427)
In reply to:
Ruby 2.0.0 released by marduk
Parent article:
Ruby 2.0.0 released
Ruby
def cycle(first_value, *values)
options = values.extract_options!
name = options.fetch(:name, 'default')
Python
def cycle(first_value, name=default):
or alternatively
def cycle(first_value, **values):
name = values.get('name', 'default')
Both Python versions looks much simpler to me.
(
Log in to post comments)