Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #100731
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Vincent Davis <vincent@vincentdavis.net> |
| Newsgroups | comp.lang.python |
| Subject | unicodedata with chr() not the same between python 3.4 and 3.5 |
| Date | Tue, 22 Dec 2015 09:27:05 -0600 |
| Lines | 13 |
| Message-ID | <mailman.59.1450798048.2237.python-list@python.org> (permalink) |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | base64 |
| X-Trace | news.uni-berlin.de U1CgBY8lJL1lTTSHg9pRMQeohjK48Xn7yPGWrIjnvhHA== |
| Return-Path | <vincent@vincentdavis.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.021 |
| X-Spam-Evidence | '*H*': 0.96; '*S*': 0.00; 'integers': 0.09; 'subject:same': 0.09; 'python': 0.10; 'subject:not': 0.11; 'subject:python': 0.14; '>>>': 0.15; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:between': 0.16; '>>>': 0.20; 'to:name:python-list@python.org': 0.20; "skip:' 40": 0.22; 'import': 0.24; 'message-id:@mail.gmail.com': 0.27; "skip:' 10": 0.28; 'skip:u 20': 0.28; 'skip:( 20': 0.28; 'code': 0.30; "skip:' 20": 0.34; 'received:google.com': 0.35; 'mapping': 0.35; 'unicode': 0.35; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'skip:& 10': 0.37; 'received:209': 0.38; 'subject:the': 0.39; 'received:209.85.214': 0.39; 'to:addr:python.org': 0.40; 'subject:with': 0.40; '8bit%:93': 0.60; '8bit%:95': 0.65; 'between': 0.65; '3.4': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=vincentdavis.net; s=google; h=mime-version:from:date:message-id:subject:to:content-type; bh=U5oleBeSWMLdd/U4w8kBQ/QEso4a7Qd/DUbOWeBuQhE=; b=IAM58ZwmBTgmvZ64ZJ4Nfi0bFVNwU18qacZzWzgZVZAQlZlBCkNOX93ANvfX8Ltctq 5yeQEPa+KFiclDILGO7AmTLhJBFeH/gmgR3SKufGJpFG3LcE5n+ASflm8Ea3BnnP9dwo rBHgZmhYLRfnV8YcRNJfEn7vJt49ytOwVH9us= |
| X-Google-DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=U5oleBeSWMLdd/U4w8kBQ/QEso4a7Qd/DUbOWeBuQhE=; b=jNI/KfW18Gcs0H+wMZsMjCdADD+h8Nv2uKexijj97AglJP9b9CUx6I4IRU6nGSFUqd 1Y+ssIrHCTJLdsZF4pNRarhWK1SDr1Gg3l15ujP8nuECtsHpypkKp/5CwDmbap1n+QT2 tTNA6a/c1sj/Q0jD5Fx45HetGWzlchDhVS6MMBo6DY2WJq6npHbo+B1khtetXe96Ne0m MLW7y1sOoLCHT/iAb+0haU2f+o6M/ef/bRckSt0ptkPR1AnQYMNa8tFIEU4FPcx9dhb8 vaRIKUMCOnOXvKY01tYWk3d1nuLpIY7HUG08c9sWqQ+IudwJR/T2qIRS7+/BYp4vlUNd sNUA== |
| X-Gm-Message-State | ALoCoQnSAcjO0XP1u5Uo0L5+7XusBq/Ho2bA0B6cSNI0UqSXTrKDgmEIK/FqPdKPN+uGpZbnk3Dv3YCQ7S+NfIn7sopwldOje2ehFkaC2wCP+hj2Kbp6iPw= |
| X-Received | by 10.182.29.166 with SMTP id l6mr11445325obh.55.1450798045670; Tue, 22 Dec 2015 07:27:25 -0800 (PST) |
| X-Content-Filtered-By | Mailman/MimeDel 2.1.20+ |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| 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:100731 |
Show key headers only | View raw
I was expecting the code below to be the same between python3.4 and 3.5. I
need a mapping between the integers and unicode that is consistant between
3.4 and 3.5
>>>
import unicodedata
>>>
u = ''.join(chr(i) for i in range(65536) if (unicodedata.category(chr(i))
in ('Lu', 'Ll')))[945:965]
>>> u
'ԡԢԣԤԥԦԧԨԩԪԫԬԭԮԯԱԲԳԴԵ'
Python 3.4
>>>
import unicodedata
>>>
u = ''.join(chr(i) for i in range(65536) if (unicodedata.category(chr(i))
in ('Lu', 'Ll')))[945:965]
>>> u
'ԢԣԤԥԦԧԱԲԳԴԵԶԷԸԹԺԻԼԽԾ'
As you can see they are not the same
.
'ԡԢԣԤԥԦԧԨԩԪԫԬԭԮԯԱԲԳԴԵ'
'ԢԣԤԥԦԧԱԲԳԴԵԶԷԸԹԺԻԼԽԾ'
Vincent Davis
720-301-3003
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
unicodedata with chr() not the same between python 3.4 and 3.5 Vincent Davis <vincent@vincentdavis.net> - 2015-12-22 09:27 -0600
csiph-web