[Bug 16725] Treat omitted dictionary the same as empty dictionary

https://www.w3.org/Bugs/Public/show_bug.cgi?id=16725

Tab Atkins Jr. <jackalmage@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jackalmage@gmail.com

--- Comment #4 from Tab Atkins Jr. <jackalmage@gmail.com> 2012-04-26 01:05:07 UTC ---
(In reply to comment #3)
> Given that dictionaries always describe what is essentially a collection of
> optional arguments, are there really cases when a dictionary member will be
> non-optional?

Yes.  In languages with *proper* keyword-arg support, keywords args are also
sometimes used simply to make some of their arguments more comprehensible.  

For example, a db library I wrote for myself several years back took some
connection arguments in its constructor.  You were required to pass the db
name, but the username and password were optional.  All of them were keyword
arguments, though, to make it clearer in reading.

That said, this definitely seems to be a minority case.  In most cases I expect
that the dict will be just optional arguments, and so omitting it would be
acceptable.

Plus, if you *require* a dictionary, it's almost certainly not the mere
presence of the dictionary you need, but rather the presence of certain members
(and perhaps those members with certain values).  You'd need to test for this
in the prose anyway so you can throw an exception, so it doesn't seem valuable
to just make the mere absence of a dictionary throw by default.

So, I support this change.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Received on Thursday, 26 April 2012 01:05:11 UTC