Deutsch   English   Français   Italiano  
<attribution-20231207165650@ram.dialup.fu-berlin.de>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!newsreader4.netcologne.de!news.netcologne.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: fr.comp.lang.python
Subject: Re: Tricher au scrabble...
Date: 7 Dec 2023 15:57:34 GMT
Organization: Stefan Ram
Lines: 24
Expires: 1 Dec 2024 11:59:58 GMT
Message-ID: <attribution-20231207165650@ram.dialup.fu-berlin.de>
References: <uk4fm4$852n$1@dont-email.me> <recherche-20231128131821@ram.dialup.fu-berlin.de> <uk51rm$auel$2@dont-email.me> <656a1a3b$0$10088$426a74cc@news.free.fr> <656a1e57$0$10088$426a74cc@news.free.fr> <874jh1tlp1.fsf@gnus.org> <6570f414$0$27068$426a74cc@news.free.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 0CUUW9yXn0p4M9xnlBllCAj2aEbKnX742siOfDZZOiEQlL
Cancel-Lock: sha1:p/xCXwcPLtxYmajwr5bU6Mgvry8= sha256:qfp/QZzK0+b7V+ksyKqbn2066msA/uVnwL5tjjcHmkY=
X-Copyright: (C) Copyright 2023 Stefan Ram. All rights reserved.
	Distribution through any means other than regular usenet
	channels is forbidden. It is forbidden to publish this
	article in the Web, to change URIs of this article into links,
        and to transfer the body without this notice, but quotations
        of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
	services to mirror the article in the web. But the article may
	be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: fr-FR
Accept-Language: de-DE-1901, en-US, it, fr-FR
Bytes: 2327

yves <yves@free.invalid> writes:
>Le Sat, 02 Dec 2023 03:48:09 +0100, Michel a écrit:
>>while line := fp.readline().rstrip():
>Tiens, je ne connaissais pas cet opérateur ( := ) ni cette syntaxe.

  La syntaxe de l'instruction while est la suivante :

|while_stmt ::= "while" assignment_expression ":" suite

  . Elle ne dit donc rien directement sur les opérateurs.

  Mais ":=" apparaît directement dans la syntaxe de l'instruction
  d'expression !

|assignment_expression ::= [identifier ":="] expression

  Il y a aussi un exemple :

|while chunk := file.read(9000):
|    process(chunk)

  ("The Python Language Reference", Release 3.13.0a0).