Repository: sympy/sympy
File: sympy/printing/fortran.py (Python)

Code before:
            name=self._print(scall.name),
            args=', '.join((self._print(arg) for arg in scall.subroutine_args))
        )

    def _print_use_rename(self, rnm):
        return "%s => %s" % tuple((self._print(arg) for arg in rnm.args))

    def _print_use(self, use):
        result = 'use %s' % self._print(use.namespace)
        if use.rename != None: # Must be '!= None', cannot be 'is not None'
            result += ', ' + ', '.join([self._print(rnm) for rnm in use.rename])
        if use.only != None: # Must be '!= None', cannot be 'is not None'
            result += ', only: ' + ', '.join([self._print(nly) for nly in use.only])
        return result

    def _print_BreakToken(self, _):
        return 'exit'

    def _print_ContinueToken(self, _):
        return 'cycle'

    def _print_ArrayConstructor(self, ac):
        fmtstr = "[%s]" if self._settings["standard"] >= 2003 else '(/%s/)'
        return fmtstr % ', '.join((self._print(arg) for arg in ac.elements))

    def _print_FunctionCall(self, expr):
        return '{name}({args})'.format(
            name=self._print(expr.name),
            args=', '.join((self._print(arg) for arg in expr.function_args))
        )

    def _print_KeywordFunctionCall(self, expr):
        args = [self._print(arg) for arg in expr.function_args]

        for key, value in expr.keyword_args.items():
            args.append(f"{key}={self._print(value)}")

        return '{name}({args})'.format(
            name=self._print(expr.name),
            args=', '.join(args)
        )

    def _print_ArrayElement(self, elem):
        return '{symbol}({idxs})'.format(
            symbol=self._print(elem.name),
            idxs=', '.join((self._print(arg) for arg in elem.indices))
        )


Review comment (refactor):
This looks good. I wonder if we should move this method to CodePrinter even? If so we should probably add a test in `test_pycode.py`:
```python
def test_KeywordFunctionCall():                                                                                                                    
    assert pycode(KeywordFunctionCall('zip', (x, y), dict(strict=True))) == "zip(x, y, strict=True)"
```
I'll let you decide if you want to do so in this PR or defer it for someone else / another PR.

Code after:
            name=self._print(scall.name),
            args=', '.join((self._print(arg) for arg in scall.subroutine_args))
        )

    def _print_use_rename(self, rnm):
        return "%s => %s" % tuple((self._print(arg) for arg in rnm.args))

    def _print_use(self, use):
        result = 'use %s' % self._print(use.namespace)
        if use.rename != None: # Must be '!= None', cannot be 'is not None'
            result += ', ' + ', '.join([self._print(rnm) for rnm in use.rename])
        if use.only != None: # Must be '!= None', cannot be 'is not None'
            result += ', only: ' + ', '.join([self._print(nly) for nly in use.only])
        return result

    def _print_BreakToken(self, _):
        return 'exit'

    def _print_ContinueToken(self, _):
        return 'cycle'

    def _print_ArrayConstructor(self, ac):
        fmtstr = "[%s]" if self._settings["standard"] >= 2003 else '(/%s/)'
        return fmtstr % ', '.join((self._print(arg) for arg in ac.elements))

    def _print_KeywordFunctionCall(self, expr):
        args = [self._print(arg) for arg in expr.function_args]

        for key, value in expr.keyword_args.items():
            args.append(f"{key}={self._print(value)}")

        return '{name}({args})'.format(
            name=self._print(expr.name),
            args=', '.join(args)
        )

    def _print_ArrayElement(self, elem):
        return '{symbol}({idxs})'.format(
            symbol=self._print(elem.name),
            idxs=', '.join((self._print(arg) for arg in elem.indices))
        )