From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 7F3DA3858C60 for ; Thu, 25 Apr 2024 18:37:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7F3DA3858C60 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7F3DA3858C60 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714070264; cv=none; b=xgd+BbCZRyQfS44Rp59iod5Lj/YeeY/rHGfhX8wO7cURvmSDi9ZNpE9sgisceICy1D64TAzeRaZ/+9DM0HNKHlNhSGrcyHHguVdRtlEp7nPQuQLGeSfGzc/Ur4FydFMNybfaTlJX84qIv/1dyyi+2MZbza8bNJ+nYrERydTd3G0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714070264; c=relaxed/simple; bh=aY3E21JLobXcmq4dOYBt6wuSaRf7k8HC2JFvrM/z2WY=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=ZuUjuY3HuiDNbs42seNVfeOplDd0rKiyXP+Bra3PtGhdcXfqDrNxqq/SQ54S3ryoLdaBaYaaD/a5wLAuYFezUzawsOop2DdFloQSNTHfy2Z0hmFrRDEdw/ASMneXlu4wx4MdiveTPKOTWF3OrRl4JIvAJb8rNplzNYG/lX+X2gc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1714070261; bh=aY3E21JLobXcmq4dOYBt6wuSaRf7k8HC2JFvrM/z2WY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=u3jFkdBTQcR0mabQ3eauuVk8Y9mrpUh9Vl6SFlCTnMVapn0oYU3lSI7SbW9t6XW1q 2mF201/GejThmDQ7o7nDTvGWH0yZ89Qaxr/yhCw1ONvZ4N7/uXBbJcxkwn6vZCSET1 JZf51Uv/vnRvpALJTp3eK926FeOW31w9raoB6fQA= Received: from [172.16.0.192] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id CD9531E092; Thu, 25 Apr 2024 14:37:41 -0400 (EDT) Message-ID: <90050caa-bfc2-40b6-aa63-5c79968f3c45@simark.ca> Date: Thu, 25 Apr 2024 14:37:41 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gdb: add type annotations to ada-unicode.py To: Tom Tromey , Simon Marchi Cc: gdb-patches@sourceware.org References: <20240425172618.44739-1-simon.marchi@efficios.com> <87bk5xgv08.fsf@tromey.com> Content-Language: fr From: Simon Marchi In-Reply-To: <87bk5xgv08.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 4/25/24 2:25 PM, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> Add type annotations to ada-unicode.py, just enough to make pyright > Simon> happy: > > Ok. > Approved-By: Tom Tromey Thanks, will push. > Simon> + print( > Simon> + f" {{{r.range_start}, {r.range_end}, {r.upper_delta}, {r.lower_delta}}},", > Simon> + file=f, > Simon> + ) > > This trailing comma seems weird. When it decides to put the arguments one per like, black adds that trailing comma. I guess it avoids having a diff on this line should you add another argument after that. You can also add the trailing comma yourself to force black to put things one per line: foo = (1, 2, 3) bar = ( 1, 2, 3, ) print("foo") print( "foo", ) It sometimes makes things more readable (not in the dummy examples above, but in real life code). Simon