Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #63737

Re: Python 3 __bytes__ method

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <meltingwax@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.06; 'method,': 0.09; 'subject:method': 0.09; 'used.': 0.09; '~ethan~': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'jan': 0.12; 'compute': 0.16; 'sat,': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'this?': 0.23; 'bytes': 0.24; 'now?': 0.24; '\xa0if': 0.24; 'cc:2**0': 0.24; 'daniel': 0.26; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'object.': 0.31; 'anyone': 0.31; 'url:python': 0.33; 'entirely': 0.33; "can't": 0.35; 'received:google.com': 0.35; 'url:listinfo': 0.36; 'url:org': 0.36; 'should': 0.36; 'so,': 0.37; 'clear': 0.37; 'pm,': 0.38; 'called': 0.40; 'url:mail': 0.40; 'how': 0.40; 'read': 0.60; 'new': 0.61; 'ethan': 0.84; 'furman': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=utbsm8r6+QXxW09gMin5ctkK/Z5hrlEUXmD3RFCFbgs=; b=YVFAAAzZUxvnXnATi4bQaq4TK//8J3IhrCyirI6It1t5+ANvX9dBjENSyPW0u9zjCx sFZ//JVYlBYQAksiPBkbKmXeg4SkfEy8ZBaLFMlVSB8LHWeO5h00ZsRI7MNjt8GjjKxw WCk3iqOFjUmC4CYhxn69RL7Gl0oTZEbUQ+J6V+ayOhN/b7mF7JZsTfQ1WPLUDT0DxU9g gM0/vhPKQPwc54ZZI3LkCorBRKSKrCXCrvqgYzhjzB52GIDV54duMVK3B8wrPTDHtmJk FqaQfwKZi8R6aVcF2XL4PjttPDVsuNjX7oaGygEB7PkCP+a0G91UPeJrPBpv/erB9XDt JypQ==
MIME-Version 1.0
X-Received by 10.180.90.79 with SMTP id bu15mr8843617wib.33.1389487986851; Sat, 11 Jan 2014 16:53:06 -0800 (PST)
Sender meltingwax@gmail.com
In-Reply-To <52D1E0CE.5030906@stoneleaf.us>
References <52D1E0CE.5030906@stoneleaf.us>
Date Sat, 11 Jan 2014 19:53:06 -0500
X-Google-Sender-Auth WZAs1B7loLPBTJrIaj3Q5CbYFWQ
Subject Re: Python 3 __bytes__ method
From Daniel da Silva <var.mail.daniel@gmail.com>
To Ethan Furman <ethan@stoneleaf.us>
Content-Type multipart/alternative; boundary=f46d043c092ee0472504efbb6135
X-Mailman-Approved-At Sun, 12 Jan 2014 02:24:49 +0100
Cc Python <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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>
Newsgroups comp.lang.python
Message-ID <mailman.5347.1389489890.18130.python-list@python.org> (permalink)
Lines 52
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1389489890 news.xs4all.nl 2952 [2001:888:2000:d::a6]:55670
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:63737

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Where did you read this? I can't find any documentation about __bytes__ on
google.

Regards,
Daniel


On Sat, Jan 11, 2014 at 7:24 PM, Ethan Furman <ethan@stoneleaf.us> wrote:

> Python 3 has a new method, __bytes__.  The docs say: Called by bytes() to
> compute a byte-string representation of an object. This should return a
> bytes object.
>
> I must admit I'm not entirely clear how this should be used.  Is anyone
> using this now?  If so, how?
>
> --
> ~Ethan~
> --
> https://mail.python.org/mailman/listinfo/python-list
>

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Python 3 __bytes__ method Daniel da Silva <var.mail.daniel@gmail.com> - 2014-01-11 19:53 -0500

csiph-web