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


Groups > comp.lang.python > #83233

Re: surprise - byte in set

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <am1r.ar3alan@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.061
X-Spam-Evidence '*H*': 0.88; '*S*': 0.00; 'subject:set': 0.09; 'jan': 0.12; '&gt;&gt;': 0.16; "'b'": 0.16; 'binary.': 0.16; 'happened?': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'trying': 0.19; 'patrick': 0.19; 'result.': 0.19; '>>>': 0.22; 'email addr:gmail.com&gt;': 0.22; '&gt;&gt;&gt;': 0.24; 'byte': 0.24; '---': 0.24; 'header:In- Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'skip:( 20': 0.30; 'url:mailman': 0.30; 'url:python': 0.33; 'test': 0.35; 'received:google.com': 0.35; 'false': 0.36; 'url:listinfo': 0.36; 'url:org': 0.36; 'skip:& 10': 0.38; 'to:addr:python-list': 0.38; 'list,': 0.38; 'planning': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'first': 0.61; 'today': 0.64; 'wish': 0.70; '2014,': 0.84; '2015': 0.84; 'avast': 0.84; 'have\xc2\xa0': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=w8+ROOexjPFyOxySOtbUjdfw4UGvWzBUwpWN2c0UUdA=; b=ASUcZm/7MEBLMDQNzwZM9BJ1hsGGApuuVn086wTMRAn60Bh8SjmJ4N87KT5sKftdTv kqdr4M0dbTT8Lq9HAACb2R9paCYo+HFbxbH7exFgYO64nYoPjeaOVy5AJU8RjWXhgiHu XfamdR5mjdCR5pzexTbvyDNpVRRj8C8ui57IQTaqYRMe/tnojgMGqXTgAsxncFAHCiB1 zJbI2h1cFpuWnnCrL4AHJxkQuh3gYPIO6S0HKHoQBkJG2gG70t4VZOFTsnv1DfiQ2W8l 7JxL9qgMMRCK+sq1VO89UWKrIZhpxPAdg4UFvq2j7PAFGvZFC4EPWOKT6b4qmuEP2Ohn Dsdw==
MIME-Version 1.0
X-Received by 10.194.62.235 with SMTP id b11mr84832002wjs.73.1420312122921; Sat, 03 Jan 2015 11:08:42 -0800 (PST)
In-Reply-To <CANNmrNZAH0gbk=UQgmXDRpPcs21tD0yVE-eEXSqPjbqpJ573=A@mail.gmail.com>
References <54a83a19$0$6953$e4fe514c@dreader36.news.xs4all.nl> <CANNmrNZAH0gbk=UQgmXDRpPcs21tD0yVE-eEXSqPjbqpJ573=A@mail.gmail.com>
Date Sat, 3 Jan 2015 22:38:42 +0330
Subject Re: surprise - byte in set
From Amir Arsalan <am1r.ar3alan@gmail.com>
To python-list@python.org
Content-Type multipart/alternative; boundary=047d7ba96ed88e97a0050bc42fa2
X-Mailman-Approved-At Mon, 05 Jan 2015 13:06:12 +0100
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.17386.1420459573.18130.python-list@python.org> (permalink)
Lines 93
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1420459573 news.xs4all.nl 2896 [2001:888:2000:d::a6]:60787
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:83233

Show key headers only | View raw


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

Hi my friends.

On last result you have  a , b , c  binary.

>> set('abc')
{'a','b','c')
>> set(b'abc')
{97,98,99}
On Jan 3, 2015 10:25 PM, "patrick vrijlandt" <pvrijlandt@gmail.com> wrote:

> Hello list,
>
> Let me first wish you all the best in 2015!
>
> Today I was trying to test for occurrence of a byte in a set ...
>
> >>> sys.version
> '3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05) [MSC v.1600 32 bit
> (Intel)]'
> >>> 'b' in 'abc'
> True
> >>> b'b' in b'abc'
> True
> >>> 'b' in set('abc')
> True
> >>> b'b' in set(b'abc')
> False
>
> I was surprised by the last result. What happened?
> (Examples simplified; I was planning to manipulate the set)
>
> Patrick
>
> ---
> Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware.
> http://www.avast.com
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>

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


Thread

surprise - byte in set patrick vrijlandt <pvrijlandt@gmail.com> - 2015-01-03 19:50 +0100
  Re: surprise - byte in set Jason Friedman <jsf80238@gmail.com> - 2015-01-03 12:12 -0700
  Re: surprise - byte in set Dan Stromberg <drsalists@gmail.com> - 2015-01-03 11:15 -0800
  Re: surprise - byte in set Gary Herron <gherron@digipen.edu> - 2015-01-03 12:05 -0800
  Re: surprise - byte in set patrick vrijlandt <pvrijlandt@gmail.com> - 2015-01-03 23:08 +0100
  Re: surprise - byte in set Amir Arsalan <am1r.ar3alan@gmail.com> - 2015-01-03 22:38 +0330

csiph-web