[Tutor] Python Documentation Clarification

Huy Ton That huyslogic at gmail.com
Mon Jul 12 17:50:32 CEST 2010


Proverbial Ah-ha moment all. This clarifies things greatly (:

Thanks you all!!

On Mon, Jul 12, 2010 at 11:29 AM, Nick Raptis <airscorp at otenet.gr> wrote:

>
>
>> compile(source, filename, mode[, flags[, dont_inherit]])
>>
>> I see within this built in function, the first argument can be what they
>> define as source, the second argument as the filename and the third as the
>> mode.
>>
>> But what confuses me is sometimes I see a bracket, above as [, flags[,
>> dont_inherit]]. Is this an optional argument like flags=dont_inherit?
>>
>>
>>  Brackets do indeed mean optional arguments.
> So you can do
> compile(source, filename, mode, flags=whatever, dont_inherit=True)
> or something.
>
> The nested brackets most likely show that (in your example), dont_inherit
> is optional, but can be used only if you (optionally) also provide the flags
> argument.
>
> Of course, don't take my word for it and read the rest of the description
> in the documentation.
>
> Also read here:
> <http://docs.python.org/reference/introduction.html?highlight=brackets>
> http://docs.python.org/reference/introduction.html?highlight=brackets#notation
>
> Nick
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100712/2af50a1a/attachment.html>


More information about the Tutor mailing list