blob: b94ff5248e6f82ee2594b26c9d8f335853bae2a2 [file] [log] [blame]
Rickard Bolinbc6ee582022-11-04 08:24:29 +00001# SPDX-FileCopyrightText: Copyright 2020-2021 Arm Limited and/or its affiliates <open-source-office@arm.com>
Patrik Gustavsson8f1f9aa2021-06-28 07:41:58 +02002#
3# SPDX-License-Identifier: Apache-2.0
4#
5# Licensed under the Apache License, Version 2.0 (the License); you may
6# not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an AS IS BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Rickard Bolinbc6ee582022-11-04 08:24:29 +000016#
Patrik Gustavsson8f1f9aa2021-06-28 07:41:58 +020017# Description:
18# Utility functions used in supported operator checking
19
20
21def list_formatter(arg):
22 # Order and join into a string representation
23 return ", ".join(sorted(map(str, arg)))
24
25
26# Custom decorator function to allow formatting docstrings containing "{}"
27def docstring_format_args(args):
28 def docstring(func):
29 func.__doc__ = func.__doc__.format(*args)
30 return func
31
32 return docstring