documentation - How to interpret python call signatures with nested lists -


i have been looking @ documentation python datetime library, , confused call signatures. example, datetime.timedelta can called in following way

datetime.timedelta(10, 68400) 

however, call signature documented as

datetime.timedelta([days[, seconds[, microseconds[, milliseconds[, minutes[, hours[, weeks]]]]]]]) 

i uncertain how interpret nested lists in call signature, , how relate ways in can call timedelta.

there related answer here, , duplicate of question: what square brackets, "[]", mean in function/class documentation?

either can give options in order, example: timedelta(1, 2, 3) 1 day, 2 seconds , 3 microseconds, or specify arguments you're interested in: timedelta(days=1, microseconds=4) , allows put them in order, and/or omit options don't need.

edit: ok think answer: why python function docs include comma after bracket optional args?


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -