Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use keyword arguments instead of variable length argument list #13

Open
chiplet opened this issue Nov 16, 2021 · 2 comments
Open

Use keyword arguments instead of variable length argument list #13

chiplet opened this issue Nov 16, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@chiplet
Copy link

chiplet commented Nov 16, 2021

In a recent discussion with @mkosunen it was brought up that keyword arguments **kwargs should be preferred instead of using *args. This project still uses the *args for entity/controller initialization in at least the following locations:

def __init__(self,*arg):

def __init__(self,*arg):

@chiplet chiplet added the enhancement New feature or request label Nov 16, 2021
@mkosunen
Copy link
Member

mkosunen commented Nov 16, 2021

This is kind of embarassing. I think this is the only occasion where I have done this, the first hack just to get it to work, and it just have not been changed. That first argument is supposed to be parent instance, if it is given.

But you are right, we should change it, and now we shoud figure out how to do it so that the change is backwards compatible and does not break every entity ever written for thesydekick :)

@Roenski
Copy link
Contributor

Roenski commented Sep 1, 2022

Could you just use both? Keyword args are named arguments anyways, so they shouldn't break the variable length arguments.

def __init__(self,*arg,**kwargs):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants