Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Sven R. Kunze" Newsgroups: de.comp.lang.python Subject: [Python-de] =?utf-8?q?Schleifen_die_ohne_Durchlaufen_des_Schleife?= =?utf-8?q?nk=C3=B6rpers_beendet_wurden?= Date: Thu, 24 Mar 2016 20:53:45 +0100 Lines: 21 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de psBDEvGwTxNsAHyzAKZm0gQQHAkNtrQoXTcMSZqnLF6A== Return-Path: X-Original-To: python-de@python.org Delivered-To: python-de@mail.python.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.de; s=mail201212; t=1458849227; bh=YbJJwWRICsdefyU/3FgwTXGvGf6EI3bLihTcsoPAK1I=; h=To:From:Subject:Date:From; b=H33ju4VtJRJvko7S7UbqWChbeqaUErrA8pwd4puUcAT10TuORbkHf0/XRSNPUnjIP bwQL+Nr/mx5gmXfgBs07hOmCusJFAmPPeE+75EzQiqejOAWkZQQO6HgqpfmXn3SkjV WP7udVoFG+BNTWkTSAu7p7YX+zygBTwH17SER//A= X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 622 X-purgate-ID: 154282::1458849227-000009F3-EF5DFF81/0/0 X-BeenThere: python-de@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Die Deutsche Python Mailingliste List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com de.comp.lang.python:4323 Hallo, neulich hatten wir wieder das Problem, dass wir gerne etwas in der folgenden Art uns gewünscht hätten: for item in collection: # do for item empty: # do when collection is empty Leider bietet Python, im Gegensatz zu Django oder jinja2, keine Unterstützung für diesen Anwendungsfall. Kennt ihr das Problem auch? Und was haltet ihr von einem (wie auch immer gearteten) Keyword, der dies leicht und fehlerfrei ermöglicht. Zur Zeit gibt es schon eine längliche Diskussion auf python-ideas und python-list bezüglich einer idiomatischen bzw. syntaktischen Lösung. vG Sven