Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #102963
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Random832 <random832@fastmail.com> |
| 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 | <mailman.142.1455547651.22075.python-list@python.org> (permalink) |
| References | <n9sie9$91s$1@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.uni-berlin.de cAQ1Se6PBW7esxvcMws60QkrND5BcLPQnd76QQquIO/Q== |
| Return-Path | <random832@fastmail.com> |
| 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 | <n9sie9$91s$1@dont-email.me> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.21rc2 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Xref | csiph.com comp.lang.python:102963 |
Show key headers only | View raw
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.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
repr( open('/etc/motd', 'rt').read() ) "Veek. M" <vek.m1234@gmail.com> - 2016-02-15 18:35 +0530
Re: repr( open('/etc/motd', 'rt').read() ) Random832 <random832@fastmail.com> - 2016-02-15 09:47 -0500
Re: repr( open('/etc/motd', 'rt').read() ) Terry Reedy <tjreedy@udel.edu> - 2016-02-15 15:03 -0500
Re: repr( open('/etc/motd', 'rt').read() ) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-02-16 17:43 +1100
csiph-web