Cannot access PySide.__version__!

2017-07-15 Thread Paulo da Silva
Hi! The problem: import PySide print(PySide.__version__) AttributeError: 'module' object has no attribute '__version__' How can I fix this? Other PySide examples seem to work fine! Thanks for any help. Further information: /usr/lib64/python3.4/site-packages/PySide contains only .so files /u

Re: Cannot access PySide.__version__!

2017-07-15 Thread Paulo da Silva
Às 07:55 de 15-07-2017, Paulo da Silva escreveu: > Hi! > > The problem: > > import PySide > print(PySide.__version__) > > AttributeError: 'module' object has no attribute '__version__' > > How can I fix this? > > Other PySide examples seem to work fine! > > Thanks for any help. > > Further i

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Marko Rauhamaa
Steve D'Aprano : > On Sat, 15 Jul 2017 04:10 am, Marko Rauhamaa wrote: >> Python3's strings don't give me any better random access than UTF-8. > > Say what? Of course they do. > > Python 3 strings (since 3.3) are a compact form of UTF-32. Without loss of > generality, we can say that each string i

ANN: Python bytecode assembler, xasm

2017-07-15 Thread rocky
I may regret this, but there is a very alpha Python bytecode assembler. https://pypi.python.org/pypi/xasm -- https://mail.python.org/mailman/listinfo/python-list

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Steve D'Aprano
On Sat, 15 Jul 2017 05:50 pm, Marko Rauhamaa wrote: > Steve D'Aprano : > >> On Sat, 15 Jul 2017 04:10 am, Marko Rauhamaa wrote: >>> Python3's strings don't give me any better random access than UTF-8. >> >> Say what? Of course they do. >> >> Python 3 strings (since 3.3) are a compact form of UTF-

is @ operator popular now?

2017-07-15 Thread oyster
as the title says. has @ been used in projects? -- https://mail.python.org/mailman/listinfo/python-list

Re: is @ operator popular now?

2017-07-15 Thread Matt Wheeler
On Sat, 15 Jul 2017, 12:35 oyster, wrote: > as the title says. has @ been used in projects? > Strictly speaking, @ is not an operator. It delimits a decorator statement (in python statements and operations are not the same thing). However, to answer the question you actually asked, yes, all the

Re: is @ operator popular now?

2017-07-15 Thread Christian Heimes
On 2017-07-15 14:05, Matt Wheeler wrote: > On Sat, 15 Jul 2017, 12:35 oyster, wrote: > >> as the title says. has @ been used in projects? >> > > Strictly speaking, @ is not an operator. > It delimits a decorator statement (in python statements and operations are > not the same thing). > However,

Re: is @ operator popular now?

2017-07-15 Thread Peter Otten
Matt Wheeler wrote: >> as the title says. has @ been used in projects? numpy, probably? > Strictly speaking, @ is not an operator. In other words it's not popular, not even widely known. Compare: $ python3.4 -c '__pete...@web.de' File "", line 1 __pete...@web.de ^ SyntaxErr

Re: is @ operator popular now?

2017-07-15 Thread Chris Angelico
On Sat, Jul 15, 2017 at 11:05 PM, Peter Otten <__pete...@web.de> wrote: > Matt Wheeler wrote: > >>> as the title says. has @ been used in projects? > > numpy, probably? > >> Strictly speaking, @ is not an operator. > > In other words it's not popular, not even widely known. > > Compare: > > $ pytho

Re: is @ operator popular now?

2017-07-15 Thread Peter Otten
Chris Angelico wrote: > On Sat, Jul 15, 2017 at 11:05 PM, Peter Otten <__pete...@web.de> wrote: >> Matt Wheeler wrote: >> as the title says. has @ been used in projects? >> >> numpy, probably? >> >>> Strictly speaking, @ is not an operator. >> >> In other words it's not popular, not even wide

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Marko Rauhamaa
Steve D'Aprano : > On Sat, 15 Jul 2017 05:50 pm, Marko Rauhamaa wrote: >> I might want random access to the "Grapheme clusters, a.k.a.real >> characters". > > That would be nice to have, but the truth is that for most coders, > Unicode code points are the low-hanging fruit that get you 95% of the

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Rick Johnson
On Friday, July 14, 2017 at 2:40:43 AM UTC-5, Chris Angelico wrote: [...] > IMO the Python str type is adequate as a core data type. What we may > need, though, is additional utility functions, eg: > > * unicodedata.grapheme_clusters(str) - split str into a sequence of > grapheme clusters > * pang

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Rick Johnson
On Friday, July 14, 2017 at 2:40:43 AM UTC-5, Chris Angelico wrote: > [...] > What is the length of a string? How often do you actually > care about the number of grapheme clusters - and not, for > example, about the pixel width? (To columnate text, for > instance, you need to know about its width

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Rick Johnson
On Friday, July 14, 2017 at 12:43:50 PM UTC-5, Steve D'Aprano wrote: > Before you answer, does your answer apply to Arabic and > Thai as well as Western European languages? I find it interesting that those who bellyache the loudest about the "inclusivity of regional charator encodings" never dabbl

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Chris Angelico
On Sun, Jul 16, 2017 at 12:01 AM, Marko Rauhamaa wrote: > Steve D'Aprano : > >> On Sat, 15 Jul 2017 05:50 pm, Marko Rauhamaa wrote: >>> I might want random access to the "Grapheme clusters, a.k.a.real >>> characters". >> >> That would be nice to have, but the truth is that for most coders, >> Unic

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Chris Angelico
On Sun, Jul 16, 2017 at 12:08 AM, Rick Johnson wrote: > On Friday, July 14, 2017 at 2:40:43 AM UTC-5, Chris Angelico wrote: >> [...] >> What is the length of a string? How often do you actually >> care about the number of grapheme clusters - and not, for >> example, about the pixel width? (To colu

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Steve D'Aprano
On Sun, 16 Jul 2017 12:01 am, Marko Rauhamaa wrote: > It does seem to me UTF-8 is a better waiting position than strings. > Strings give you more trouble while not truly solving any problems. /face-palm Okay, that's it, this conversation is over. You have no clue what you are talking about. ht

Re: "Edit with IDLE" doesn't work any more ?

2017-07-15 Thread jonathan . blanck89
Am Freitag, 28. April 2017 14:48:22 UTC+2 schrieb Yip, Kin: > Hi, > > I've finally known why By chance, I went to the installation directory > : C:\Program Files\Python36\Lib\tkinter > > to check on files. I did "EDIT with IDLE" on any files there. It all works > ! Then, I went bac

Re: is @ operator popular now?

2017-07-15 Thread Matt Wheeler
On Sat, 15 Jul 2017, 13:49 Christian Heimes, wrote: > @ is an actual operator in Python. It was added in Python 3.5 as infix > matrix multiplication operator, e.g. > >m3 = m1 @ m2 > TIL The operator is defined in PEP 465, > https://www.python.org/dev/peps/pep-0465/ Perhaps it should also

Re: pyserial and end-of-line specification

2017-07-15 Thread Andre Müller
Just take a look into the documentation: https://docs.python.org/3/library/io.html#io.TextIOWrapper And in the example of Pyserial: http://pyserial.readthedocs.io/en/latest/shortintro.html#eol I think it shold be: sio = io.TextIOWrapper(io.BufferedRWPair(ser, ser), newline='yourline_ending') But

Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Mikhail V
On Sat, 15 Jul 2017 05:50 pm, Marko Rauhamaa wrote: > Random access to code points is as uninteresting as random access to > UTF-8 bytes. > I might want random access to the "Grapheme clusters, a.k.a.real > characters". What _real_ characters are you referring to? If your data has "á" (U00E1), the

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Gregory Ewing
Chris Angelico wrote: Hold on, let me just grab my MUD client, which is already using a fixed width font... -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 忘掉那 無形鎖 الثلج لا يشعرني بإكتئاب הקור לא מפריע לי, לא חודר U+1680 is " " U+200B is "" U+180E is "᠎" 다 잊어 다 ᄋ

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Chris Angelico
On Sun, Jul 16, 2017 at 9:50 AM, Gregory Ewing wrote: > Chris Angelico wrote: >> >> Hold on, let me just grab my MUD >> client, which is already using a fixed width font... >> >> >> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- >> 忘掉那 無形鎖 >> الثلج لا يشعرني بإكتئا

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Steve D'Aprano
On Sun, 16 Jul 2017 12:31 am, Rick Johnson wrote: > I never hear Chinese or eastern Europeans > bellyaching Do you speak much to Chinese and Eastern Europeans who don't speak or write English? How would you know what they say? "All toupées are bad. I've never seen a good one that looked real."

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Rick Johnson
On Saturday, July 15, 2017 at 7:29:14 PM UTC-5, Chris Angelico wrote: > [...] Also, that doesn't deal with > U+200B or U+180E, which have well-defined widths *smaller* than > typical Latin letters. (200B is a zero-width space. Is it a > character?) Of *COURSE* it's a character. Would you also con

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Chris Angelico
On Sun, Jul 16, 2017 at 11:20 AM, Rick Johnson wrote: > On Saturday, July 15, 2017 at 7:29:14 PM UTC-5, Chris Angelico wrote: >> [...] Also, that doesn't deal with >> U+200B or U+180E, which have well-defined widths *smaller* than >> typical Latin letters. (200B is a zero-width space. Is it a >> c

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread MRAB
On 2017-07-16 02:20, Rick Johnson wrote: On Saturday, July 15, 2017 at 7:29:14 PM UTC-5, Chris Angelico wrote: [...] Also, that doesn't deal with U+200B or U+180E, which have well-defined widths *smaller* than typical Latin letters. (200B is a zero-width space. Is it a character?) Of *COURSE*

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Rick Johnson
On Saturday, July 15, 2017 at 7:55:46 PM UTC-5, Steve D'Aprano wrote: > On Sun, 16 Jul 2017 12:31 am, Rick Johnson wrote: > > > I never hear Chinese or eastern Europeans > > bellyaching > > Do you speak much to Chinese and Eastern Europeans who > don't speak or write English? How would you know w

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Ben Finney
MRAB writes: > You need to be careful about the terminology. Definitely agreed. > > Is linefeed a character? You might call it a "control character", but > it's not really a _character_, it's control/format _code_. And yet the ASCII and Unicode standard says code point 0x0A (U+000A LINE FEED) i

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Rick Johnson
On Saturday, July 15, 2017 at 8:54:40 PM UTC-5, MRAB wrote: > You need to be careful about the terminology. You are correct. I admit I was a little loose with my terms there. > Is linefeed a character? Since LineFeed is the same as NewLine, then yes, IMO, linefeed is a character. > You might c

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Rustom Mody
On Sunday, July 16, 2017 at 4:09:16 AM UTC+5:30, Mikhail V wrote: > On Sat, 15 Jul 2017 05:50 pm, Marko Rauhamaa wrote: > > Random access to code points is as uninteresting as random access to > > UTF-8 bytes. > > I might want random access to the "Grapheme clusters, a.k.a.real > > characters". >

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Rick Johnson
On Saturday, July 15, 2017 at 9:33:49 PM UTC-5, Ben Finney wrote: > MRAB writes: [...] > > Is linefeed a character? You might call it a "control > > character", but it's not really a _character_, it's > > control/format _code_. > > And yet the ASCII and Unicode standard says code point 0x0A

Decorating coroutines

2017-07-15 Thread Michele Simionato
I have just released version 4.1.1 of the decorator module. The new feature is that it is possible to decorate coroutines. Here is an example of how to define a decorator `log_start_stop` that can be used to trace coroutines: $ cat x.py import time import logging from asyncio import get_event_loo

Re: is @ operator popular now?

2017-07-15 Thread oyster
sorry, I mean "PEP 465 - A dedicated infix operator for matrix multiplication" on https://docs.python.org/3/whatsnew/3.5.html#whatsnew-pep-465 2017-07-15 20:05 GMT+08:00 Matt Wheeler : > On Sat, 15 Jul 2017, 12:35 oyster, wrote: >> >> as the title says. has @ been used in projects? > > > Strictl

Re: "Edit with IDLE" doesn't work any more ?

2017-07-15 Thread Rick Johnson
On Friday, April 28, 2017 at 8:23:43 AM UTC-5, Peter Otten wrote: > Stefan Ram wrote: > > > Peter Otten <__pete...@web.de> writes: > >>one of the modules in Python's standard library IDLE will try to run with > >>your module rather than the one it actually needs. Common candidates are > >>code.py

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Steven D'Aprano
On Sun, 16 Jul 2017 11:32:16 +1000, Chris Angelico wrote: > On Sun, Jul 16, 2017 at 11:20 AM, Rick Johnson > wrote: >> On Saturday, July 15, 2017 at 7:29:14 PM UTC-5, Chris Angelico wrote: >>> [...] Also, that doesn't deal with U+200B or U+180E, which have >>> well-defined widths *smaller* than t

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Chris Angelico
On Sun, Jul 16, 2017 at 2:33 PM, Rustom Mody wrote: > On Sunday, July 16, 2017 at 4:09:16 AM UTC+5:30, Mikhail V wrote: >> On Sat, 15 Jul 2017 05:50 pm, Marko Rauhamaa wrote: >> > Random access to code points is as uninteresting as random access to >> > UTF-8 bytes. >> > I might want random access

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Steven D'Aprano
On Sun, 16 Jul 2017 12:33:10 +1000, Ben Finney wrote: > And yet the ASCII and Unicode standard says code point 0x0A (U+000A LINE > FEED) is a character, by definition. [...] > > Is an acute accent a character? > > Yes, according to Unicode. ‘´’ (U+0301 ACUTE ACCENT) is a character. Do you have

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Chris Angelico
On Sun, Jul 16, 2017 at 2:25 PM, Rick Johnson wrote: > But the two "realms" and two "character types" are but only a > small sample of the syntactical complexity of Python > strings. For we haven't even discussed the many types of > string literals that Python defines. Some include: > > (1) "N

Re: Grapheme clusters, a.k.a.real characters

2017-07-15 Thread Chris Angelico
On Sun, Jul 16, 2017 at 3:37 PM, Steven D'Aprano wrote: > On Sun, 16 Jul 2017 11:32:16 +1000, Chris Angelico wrote: > >> Exactly. That's my point. Even in a monospaced font, U+200B is a >> character, yet it is by rule a zero-width character. So even in a >> monospaced font, some characters must va