Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Random832 Newsgroups: comp.lang.python Subject: Re: repr( open('/etc/motd', 'rt').read() ) Date: Mon, 15 Feb 2016 09:47:22 -0500 Lines: 7 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de cAQ1Se6PBW7esxvcMws60QkrND5BcLPQnd76QQquIO/Q== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'received:internal': 0.09; 'repr': 0.09; 'interpreter': 0.15; 'message- id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:psf.io': 0.16; 'twice.': 0.16; 'wrote:': 0.16; 'string': 0.17; 'passes': 0.18; 'feb': 0.23; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'function': 0.28; 'subject:/': 0.30; '15,': 0.30; 'gives': 0.35; '(i.e.': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'received:66': 0.38; 'means': 0.39; 'why': 0.39; 'does': 0.39; 'to:addr:python.org': 0.40; 'called': 0.40; 'header:Message-Id:1': 0.61; 'prompt': 0.79; 'subject:( ': 0.84 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=aBSlA39QQLfaBxEwizenfd26O+U=; b=MznYMm 2Jf66xr+B3TV/NQSgFyQLr2ZZtF/DsHWp1kWOvYFzd2W7Gw3XlOl/o5PcHPNPcz5 UdT1g4vECnCHpvymYlA4xkQ8kBe+JZMC3eYz3kO5GytPWOBXglsNeqQGNpxvSWTt V++b/kVbFqNymkguNTP41lyvOBvd2ObPKqY+U= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=aBSlA39QQLfaBxE wizenfd26O+U=; b=iLprvEGe6wU56otwYjBAmF2LPh8Fz4OnF9T0Dr3H1VlRsly V4kv0xOudpF6M269Ffb2imjdXqDG6BRAihRUz7mudMno0Hm4tmxAD+pFrua7aS2M DOfHlg2fcn2esyfXrzevuSWeZQxRQI//4o0EQkStJmCMyK//Vh09RrxgmDIE= X-Sasl-Enc: EkYCe5+COVPBat8lVM9SE1Wc5UeOAdkUt6p6nQbnXt+f 1455547642 X-Mailer: MessagingEngine.com Webmail Interface - ajax-aeec9b65 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:102963 On Mon, Feb 15, 2016, at 08:05, Veek. M wrote: > What is happening with # 1 # (repr)? > repr calls __repr__ which gives you bytes.. why does this result in \\n When you call a function that returns a string directly in the interpreter prompt (i.e. without print), it passes the result to repr, which means in this case repr has been called twice.