GetStream / stream-python

Python Client - Build Activity Feeds & Streams with GetStream.io
https://getstream.io
BSD 3-Clause "New" or "Revised" License
142 stars 40 forks source link

Proposal: simplify implementation by dropping intermediary variable #95

Closed ferhatelmas closed 4 years ago

ferhatelmas commented 5 years ago

Problem explanation

Nothing specifically wrong but could be improved, IMHO.

        response = self.client.post(
            resource,
            service_name="personalization",
            params=params,
            signature=self.token,
            data=data,
        )
        return response

Generally, previous idiom is followed but response could be returned directly without losing any significant information but it might improve readability by making implementation shorter since it's repeated many times.

Suggestion is as following:

-        response = self.client.post(
+        return self.client.post(
             resource,
             service_name="personalization",
             params=params,
             signature=self.token,
             data=data,
         )
-        return response

Steps to reproduce

None, above description is self contained.

Environment info

N/A

Error traceback (if applicable)

N/A

Code snippet that causes the problem

N/A

ferhatelmas commented 4 years ago

so what is the result? No need to bother?

tbarbugli commented 4 years ago

Yup

On Thu, Nov 7, 2019, 9:52 AM ferhat elmas notifications@github.com wrote:

so what is the result? No need to bother?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/GetStream/stream-python/issues/95?email_source=notifications&email_token=AAAVVH52ADQFQOJUQRFXELLQSRBUZA5CNFSM4IUVJRVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDNCFLQ#issuecomment-551166638, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAVVH7P55EFIAZ5TWUTQPLQSRBUZANCNFSM4IUVJRVA .