Who thinks it's worth specifying which parameters to pass values to?

All other Source.Python topics and issues.
sergei721
Junior Member
Posts: 1
Joined: Fri Sep 16, 2022 4:38 pm

Who thinks it's worth specifying which parameters to pass values to?

Postby sergei721 » Fri Sep 16, 2022 4:40 pm

Code: Select all

        @staticmethod
            def _create_table(
                columns: str,
                primary_key: str,
                hash_id: str,
            ) -> str:
                sql = """CREATE TABLE ..."""
                return sql


In your opinion, is it worth specifying parameters to which values are passed (if the names of variables and parameters match)?

One of the colleagues says that it is necessary to call as for sql_create_rw.
Which call option would you choose sql_create or sql_create_rw(the method is called 1 time)?


Code: Select all

    def check_qa(
                table_name: str,
                segment: str,
                columns: str,
                primary_key: str,
                hash_id: str,
            ) -> str:
                sql_create = self._create_table(columns, primary_key, hash_id)
                sql_create_rw = self._create_table(columns=columns, primary_key=primary_key, hash_id=hash_id)
User avatar
Articha
Member
Posts: 32
Joined: Tue Sep 21, 2021 12:13 pm
Location: Russia

Re: Who thinks it's worth specifying which parameters to pass values to?

Postby Articha » Sun Sep 18, 2022 4:56 pm

Zero context information. What class is it? What library are used? SQLite3? SQLAlchemy?

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 33 guests