Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Christopher Arndt Newsgroups: de.comp.lang.python Subject: Re: [Python-de] =?utf-8?q?Schleifen_die_ohne_Durchlaufen_des_Schleif?= =?utf-8?q?enk=C3=B6rpers_beendet_wurden?= Date: Tue, 29 Mar 2016 14:48:47 +0200 Lines: 75 Message-ID: References: <56F445C9.3000200@mail.de> <56F939CE.8050601@admin-box.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4JmwBT70cJWrSDO30JnvGG9DOT2vB8Gt5" X-Trace: news.uni-berlin.de ZXO9zZ47A33if0UPlNgsnQcMHEXRKI8wSqu8GrUosQNg== Return-Path: X-Original-To: python-de@python.org Delivered-To: python-de@mail.python.org X-Virus-Scanned: Debian amavisd-new at mx1.0x20.eu Openpgp: id=F0BA1EAE86651989C0A1C9901E0D97B33A4E1F31 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 In-Reply-To: <56F939CE.8050601@admin-box.com> 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:4335 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4JmwBT70cJWrSDO30JnvGG9DOT2vB8Gt5 Content-Type: multipart/mixed; boundary="FWKKcUhTPcBVEj8QAxkW6heRdqaHoNgcu" From: Christopher Arndt To: python-de@python.org Message-ID: <56FA79AF.6050608@chrisarndt.de> Subject: =?UTF-8?Q?Re:_[Python-de]_Schleifen_die_ohne_Durchlaufen_des_Schlei?= =?UTF-8?Q?fenk=c3=b6rpers_beendet_wurden?= References: <56F445C9.3000200@mail.de> <56F939CE.8050601@admin-box.com> In-Reply-To: <56F939CE.8050601@admin-box.com> --FWKKcUhTPcBVEj8QAxkW6heRdqaHoNgcu Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Am 28.03.2016 um 16:03 schrieb Daniel Troeder: > for item in list(): > print item > if "item" not in locals(): > print "empty" >=20 > Voraussetzung ist, dass der Variablenname ("item") nicht schon vorher i= m > gleichen oder =FCbergeordneten scope verwendet wird. Dies ist aber in der Praxis m.E. schwer sicher zu stellen. Die sichere Variante w=E4re also: locals().pop('item', None) for item in items: ... if item in locals(): ... Wobei mir weiterhin dies besser gef=E4llt, weil m.E. klarer: item =3D object for item in items: ... if item is object: ... Chris --FWKKcUhTPcBVEj8QAxkW6heRdqaHoNgcu-- --4JmwBT70cJWrSDO30JnvGG9DOT2vB8Gt5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Puzzled by the all these strange characters? Comment: See http://tinyurl.com/cehoa7 for an introduction Comment: to public key encryption and signing. iQIcBAEBCAAGBQJW+nmvAAoJEB4Nl7M6Th8xLFIP/0WJsY8D/dH9YAZOom2I+MGH O2LqSAt3qNzndnEXrAV3FgLEmVkWUuR9sZ6N53CjIgs/6v/FdfwLq2k4Ijv3nlL6 /6UZ8kf3ZjjsevAyzyTQys2bmQ6q2p2VyVND1oraqBKzikWz04qcqJB90ZpocoMI iiUjPiauatzaO9t0ylMIyP/qB9R9c6V7I7pLheU+901AvykGG4ex/JZlT4r/kZ+I saB2XqinCPI8eUyPR9WRhGiR1BlG7d9vwMQemGuW7nuZ56v5su/epIfe6XR1euMG LJmnc9QORGlT/KKxBszA7PEaeZa10DxjeNUx7xPo4FIDLYVKs7jhcGYcrd1rJG40 WiQXFJndim8snAbqeYcgR8pHLanp7D36ONNiTEKMraov3N6A6bsBmZ3PmW/YKf1b 8Ne0uU9+Fp5GWtUmOQeZWLiTSgeXGoiRj7utPzdZNvgEObD4oy/Cno8k9jUOXY2D 1hxBakbB9XP73zZkbjer2JNE5NIIW10+E9WMsIK+vI2kO1LvcsdmNJ5tqdgT41a4 VSW7cTKIXzQx/qGcZ482OyKI74WfbUGreZ8qWDpqQUPru+fVeUrHw7B5qe5/9tNe M4IvmTlVHT/+azfnb8YZmtn6P8RoVzLrEng4wErL6Ft1HdyBPUaSNqHSmob+Zs87 Q+7XY9vRJYcJI4RCukag =FJ8l -----END PGP SIGNATURE----- --4JmwBT70cJWrSDO30JnvGG9DOT2vB8Gt5--