Skip to content

Conversation

x2es
Copy link

@x2es x2es commented Apr 15, 2022

When code like

return foo, bar, baz

Refactored to

return { 'foo': foo, 'bar': bar, 'baz': baz }

It's handy to refactor client part like:

++ from operator import itemgetter
-- foo, bar, baz = some_f()
++ foo, bar, baz = itemgetter('foo', 'bar', 'baz')(some_f())

When code like

```
return foo, bar, baz
```

Refactored to

```
return { 'foo': foo, 'bar': bar, 'baz': baz }
```

It's handy to refactor client part like:

```
-- foo, bar, baz = some_f()
++ foo, bar, baz = itemgetter('foo', 'bar', 'baz')(some_f())
```
@x2es
Copy link
Author

x2es commented Apr 15, 2022

I am not sure does it right place to the tip. I believe this page should refer to this tip at least.
Any suggestions?

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

Successfully merging this pull request may close these issues.

1 participant