7 ms·
I've never worked with RPython. Looking through that list it doesn't look dreadful. There are a couple of things that jump out though - you can't use kwargs in
by aidos 12y ago
I've never worked with RPython.
Looking through that list it doesn't look dreadful. There are a couple of things that jump out though - you can't use kwargs in function definitions which is probably used quite a lot in dynamic settings.
Eg in Python one might do (warning; crazy, contrived example):
def create_thing(**kwargs):
thing = dict(id=gen_id())
thing['other_data'] = kwargs
return thing
thing = create_thing(name='name', foo='bar')
You could avoid it, and generally in Python you're better off being explicit about everything. But it's definitely a feature that gets used a fair amount, especially in libraries where you don't explicitly know what the api call takes concerning user data.
An easy (more explicit) workaround would be:
def create_thing(other_data=None):
thing = dict(id=gen_id())
thing['other_data'] = other_data or {}
return thing
create_thing(dict(name='name', foo='bar'))
It's just a little more work for the calling code.