Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #35646 > unrolled thread
| Started by | "Joseph L. Casale" <jcasale@activenetwerx.com> |
|---|---|
| First post | 2012-12-27 20:16 +0000 |
| Last post | 2012-12-27 20:16 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
Function Parameters "Joseph L. Casale" <jcasale@activenetwerx.com> - 2012-12-27 20:16 +0000
| From | "Joseph L. Casale" <jcasale@activenetwerx.com> |
|---|---|
| Date | 2012-12-27 20:16 +0000 |
| Subject | Function Parameters |
| Message-ID | <mailman.1363.1356639440.29569.python-list@python.org> |
When you use optional named arguments in a function, how do you deal with with
the incorrect assignment when only some args are supplied?
If I do something like:
def my_func(self, **kwargs):
then handle the test cases with:
if not kwargs.get('some_key'):
raise SyntaxError
or:
if kwargs.get('some_key') and kwargs.get('another_key'):
...
I loose the introspection that some IDE's provide from the doc strings.
Any ideas on how to deal with this?
Thanks!
jlc
Back to top | Article view | comp.lang.python
csiph-web