Re: Users of namedtuple: do you use the _source attribute?

2017-07-18 Thread Thomas Nyberg
On 07/19/2017 05:12 AM, Steve D'Aprano wrote: > On Wed, 19 Jul 2017 08:39 am, Gregory Ewing wrote: > Um... well, people want to do all sorts of wild and wacky things... but why > would you define a named tuple with *private* fields? Especially since that > privateness isn't enforced when you access

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

2017-07-18 Thread Gregory Ewing
Chris Angelico wrote: Once you NFC or NFD normalize both strings, identical strings will generally have identical codepoints... You should then be able to use normal regular expressions to match correctly. Except that if you want to match a set of characters, you can't reliably use [...], you

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

2017-07-18 Thread Steve D'Aprano
On Mon, 17 Jul 2017 04:12 am, Ben Finney wrote: > Steven D'Aprano writes: > >> 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 cha

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

2017-07-18 Thread Steve D'Aprano
On Wed, 19 Jul 2017 10:34 am, Mikhail V wrote: > Ok, in this narrow context I can also agree. > But in slightly wider context that phrase may sound almost like: > "neither geometrical shape is better than the other as a basis > for a wheel. If you have polygonal wheels, they are still called wheel

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

2017-07-18 Thread Steve D'Aprano
On Wed, 19 Jul 2017 10:08 am, Ben Finney wrote: > Gregory Ewing writes: > >> The term "emoji" is becoming rather strained these days. >> The idea of "woman" and "personal computer" being emotions >> is an interesting one... > > I think of “emoji” as “not actually a character in any system anyon

Re: Users of namedtuple: do you use the _source attribute?

2017-07-18 Thread Steve D'Aprano
On Wed, 19 Jul 2017 08:39 am, Gregory Ewing wrote: > Steve D'Aprano wrote: >> "source_" is already a public name, which means that users could want to >> create fields with that name for some reason, > > They could equally well want to define their own private > field called "_source". Um... wel

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

2017-07-18 Thread Steve D'Aprano
On Wed, 19 Jul 2017 12:10 am, Rustom Mody wrote: > On Monday, July 17, 2017 at 10:14:00 PM UTC+5:30, Rhodri James wrote: >> On 17/07/17 05:10, Rustom Mody wrote: >> > Hint1: Ask your grandmother whether unicode's notion of character makes >> > sense. Ask 10 gmas from 10 language-L's >> > Hint2: Wh

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

2017-07-18 Thread Steve D'Aprano
On Wed, 19 Jul 2017 12:29 am, Random832 wrote: > On Sun, Jul 16, 2017, at 01:37, Steven D'Aprano wrote: >> In a *well-designed* *bug-free* monospaced font, all code points should >> be either zero-width or one column wide. Or two columns, if the font >> supports East Asian fullwidth characters. >

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

2017-07-18 Thread Steve D'Aprano
On Tue, 18 Jul 2017 11:59 pm, Chris Angelico wrote: >> (I don't think any native English words use a double-V or double-U, but the >> possibility exists.) > > vacuum. Nice. Also continuum and residuum. For double V, we have savvy, skivvy, flivver (an old slang term for cars). -- Steve “Che

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

2017-07-18 Thread Rustom Mody
On Wednesday, July 19, 2017 at 3:00:21 AM UTC+5:30, Marko Rauhamaa wrote: > Chris Angelico : > > > Let me give you one concrete example: the letter "ö". In English, it > > is (very occasionally) used to indicate diaeresis, where a pair of > > letters is not a double letter - for example, "coöperat

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

2017-07-18 Thread Steve D'Aprano
On Wed, 19 Jul 2017 12:09 am, Random832 wrote: > On Fri, Jul 14, 2017, at 08:33, Chris Angelico wrote: >> What do you mean about regular expressions? You can use REs with >> normalized strings. And if you have any valid definition of "real >> character", you can use it equally on an NFC-normalized

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

2017-07-18 Thread Chris Angelico
On Wed, Jul 19, 2017 at 10:34 AM, Mikhail V wrote: > Ok, in this narrow context I can also agree. > But in slightly wider context that phrase may sound almost like: > "neither geometrical shape is better than the other as a basis > for a wheel. If you have polygonal wheels, they are still called w

Grapheme clusters, a.k.a.real characters

2017-07-18 Thread Mikhail V
ChrisA wrote: >On Wed, Jul 19, 2017 at 6:05 AM, Mikhail V wrote: >> On 2017-07-18, Steve D'Aprano wrote: >> >>> That's neither better nor worse than the system used by English and French, >>> where letters with dicritics are not distinct letters, but guides to >>> pronunciation. >> >>>_Neither sy

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

2017-07-18 Thread Ben Finney
Gregory Ewing writes: > The term "emoji" is becoming rather strained these days. > The idea of "woman" and "personal computer" being emotions > is an interesting one... I think of “emoji” as “not actually a character in any system anyone would use for writing anything, but somehow gets to squat

Grapheme clusters, a.k.a.real characters

2017-07-18 Thread Mikhail V
Marko Rauhamaa wrote: >What did you think of my concrete examples, then? (Say, finding >"Alvárez" with the regular expression "Alv[aá]rez".) I think that should match both "Alvarez" and "Alvárez" ...? But firstly, I feel like I need to _guess_ what ideas you are presenting. Unless I open up Vim a

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

2017-07-18 Thread Gregory Ewing
Random832 wrote: What about Emoji? U+1F469 WOMAN is two columns wide on its own. U+1F4BB PERSONAL COMPUTER is two columns wide on its own. The term "emoji" is becoming rather strained these days. The idea of "woman" and "personal computer" being emotions is an interesting one... -- Greg -- htt

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

2017-07-18 Thread Gregory Ewing
Steve D'Aprano wrote: (I don't think any native English words use a double-V or double-U, but the possibility exists.) vacuum savvy (Vacuum is arguably Latin, but we've been using it for long enough that it's at least as English as most of the other words we use.) -- Greg -- https://mail.pyth

Re: Users of namedtuple: do you use the _source attribute?

2017-07-18 Thread Gregory Ewing
Steve D'Aprano wrote: "source_" is already a public name, which means that users could want to create fields with that name for some reason, They could equally well want to define their own private field called "_source". IMO a better thing to do would have been to name it "__source__". Dunder

Problem in installing module "pynamical"

2017-07-18 Thread Saikat Chakraborty
I am using PyCharm Community Edition 2017 with interpreter python 3.6.1. I want to install pynamical module. But it is showing error. I am posting the error message: E:\untitled>pip install pynamical FileNotFoundError: [WinError 2] The system cannot find the file specified error: command '

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

2017-07-18 Thread Anders Wegge Keller
På Tue, 18 Jul 2017 11:27:03 -0400 Dennis Lee Bieber skrev: > Probably would have to go to words predating the Roman occupation > (which probably means a dialect closer to Welsh or other Gaelic). > Everything later is an import (anglo-saxon being germanic tribes invading > south, Vikings in

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

2017-07-18 Thread Marko Rauhamaa
Chris Angelico : > Let me give you one concrete example: the letter "ö". In English, it > is (very occasionally) used to indicate diaeresis, where a pair of > letters is not a double letter - for example, "coöperate". (You can > also hyphenate, "co-operate".) In German, it is the letter "o" with a

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

2017-07-18 Thread Chris Angelico
On Wed, Jul 19, 2017 at 6:05 AM, Mikhail V wrote: > On 2017-07-18, Steve D'Aprano wrote: > >> That's neither better nor worse than the system used by English and French, >> where letters with dicritics are not distinct letters, but guides to >> pronunciation. > >>_Neither system is right or wrong

Grapheme clusters, a.k.a.real characters

2017-07-18 Thread Mikhail V
On 2017-07-18, Steve D'Aprano wrote: > That's neither better nor worse than the system used by English and French, > where letters with dicritics are not distinct letters, but guides to > pronunciation. >_Neither system is right or wrong, or better than the other._ If that is said just "not to

Re: pyserial and end-of-line specification

2017-07-18 Thread FS
Thank you for your response Andre. I had tried some code like that in the document but it did not seem to work. However ever leaving my terminal for a time the code eventually wrote out the records so apparently there is some very deep buffering going on here. A little more searching on the web

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

2017-07-18 Thread Chris Angelico
On Wed, Jul 19, 2017 at 4:56 AM, Marko Rauhamaa wrote: > Chris Angelico : >> What I *think* you're asking for is for square brackets in a regex to >> count combining characters with their preceding base character. > > Yes. My example tries to match a single character against a single > character.

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

2017-07-18 Thread Marko Rauhamaa
Chris Angelico : > On Wed, Jul 19, 2017 at 4:31 AM, Marko Rauhamaa wrote: >> Chris Angelico : >> >>> On Wed, Jul 19, 2017 at 3:01 AM, Marko Rauhamaa wrote: Yes. Also, not every letter can be normalized to a single codepoint so NFC is not a way out. For example, re.match("

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

2017-07-18 Thread Chris Angelico
On Wed, Jul 19, 2017 at 4:31 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> On Wed, Jul 19, 2017 at 3:01 AM, Marko Rauhamaa wrote: >>> Yes. Also, not every letter can be normalized to a single codepoint so >>> NFC is not a way out. For example, >>> >>> re.match("^[q̈]$", "q̈") >>> >>> retu

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

2017-07-18 Thread Marko Rauhamaa
Chris Angelico : > On Wed, Jul 19, 2017 at 3:01 AM, Marko Rauhamaa wrote: >> Yes. Also, not every letter can be normalized to a single codepoint so >> NFC is not a way out. For example, >> >> re.match("^[q̈]$", "q̈") >> >> returns None regardless of normalization. > > In what language or cont

RE: Best way to assert unit test cases with many conditions

2017-07-18 Thread Dan Strohl via Python-list
Ganesh; I'm not 100% sure what you are trying to do.. so let me throw out a few things I do and see if that helps... If you are trying to run a bunch of similar tests on something, changing only (or mostly) in the parameters passed, you can use self.subTest(). Like this: Def test_this(self):

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

2017-07-18 Thread Chris Angelico
On Wed, Jul 19, 2017 at 3:01 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> what you're more likely to want is "match the letter á", and you don't >> care whether it's represented as U+0061 U+0301 or as U+00E1. That's >> where Unicode normalization comes in. > > Yes. Also, not every letter can

Re: Best way to assert unit test cases with many conditions

2017-07-18 Thread Rob Gaddi
On 07/18/2017 09:56 AM, Ganesh Pal wrote: (1) should I add several asserts per test case, or just warn with the error and fail at the end . In the line 33 – 35 / 37-38 ( sorry this is a dirty pusedo-code) . Yes. Just assert each thing as it needs asserting. (2) Is there a way we can

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

2017-07-18 Thread Grant Edwards
On 2017-07-18, Anders Wegge Keller wrote: > På Tue, 18 Jul 2017 23:59:33 +1000 > Chris Angelico skrev: >> On Tue, Jul 18, 2017 at 11:11 PM, Steve D'Aprano > > >>> (I don't think any native English words use a double-V or double-U, but >>> the possibility exists.) > >> vacuum. > > That's lati

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

2017-07-18 Thread Rhodri James
On 18/07/17 17:03, Marko Rauhamaa wrote: Random832: As for double-v, a quick search through /usr/share/dict/words reveals "civvies", "divvy", "revved/revving", "savvy" and "skivvy", and various conjugations thereof. All following, more or less, the rule of using a double consonant after a short

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

2017-07-18 Thread Marko Rauhamaa
Marko Rauhamaa : > * the final consonant of a single-syllable word is doubled only if the >consonant is "k", "l" or "s" ("kick", "kill", "kiss") ... or "f" ("stiff") or "z" ("buzz") Marko -- https://mail.python.org/mailman/listinfo/python-list

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

2017-07-18 Thread Marko Rauhamaa
Chris Angelico : > what you're more likely to want is "match the letter á", and you don't > care whether it's represented as U+0061 U+0301 or as U+00E1. That's > where Unicode normalization comes in. Yes. Also, not every letter can be normalized to a single codepoint so NFC is not a way out. For

Best way to assert unit test cases with many conditions

2017-07-18 Thread Ganesh Pal
Hi Dear Python Friends, The unittest’s TestCase class provides several assert methods to check for and report failures . I need suggestion what would the best way to assert test cases in the below piece of code. (1) sh

Re: Better Regex and exception handling for this small code

2017-07-18 Thread Ganesh Pal
Thanks Cameron Simpson for you suggestion and reply quite helpful :) On Wed, Jul 12, 2017 at 5:06 AM, Cameron Simpson wrote: > On 11Jul2017 22:01, Ganesh Pal wrote: > >> I am trying to open a file and check if there is a pattern has changed >> after the task got completed? >> >> file data: >

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

2017-07-18 Thread Chris Angelico
On Wed, Jul 19, 2017 at 1:40 AM, Rhodri James wrote: > On 18/07/17 16:27, Dennis Lee Bieber wrote: >> >> On Tue, 18 Jul 2017 10:38:48 -0400, Random832 >> declaimed the following: >> >>> Define "native" then. My interpretation of "native English words" is >>> "anything you wouldn't have to put in

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

2017-07-18 Thread Chris Angelico
On Wed, Jul 19, 2017 at 12:09 AM, Random832 wrote: > On Fri, Jul 14, 2017, at 08:33, Chris Angelico wrote: >> What do you mean about regular expressions? You can use REs with >> normalized strings. And if you have any valid definition of "real >> character", you can use it equally on an NFC-normal

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

2017-07-18 Thread Marko Rauhamaa
Random832 : > As for double-v, a quick search through /usr/share/dict/words reveals > "civvies", "divvy", "revved/revving", "savvy" and "skivvy", and > various conjugations thereof. All following, more or less, the rule of > using a double consonant after a short vowel in contexts where a > single

Re: Funding continuous maintenance for PyInstaller?

2017-07-18 Thread justin walters
On Tue, Jul 18, 2017 at 3:01 AM, Hartmut Goebel < h.goe...@crazy-compilers.com> wrote: > Hi, > > I'm seeking advice how to fund continuous maintenance for an open source > project. > > *Do you have any idea how to fund continuous maintenance for PyInstaller? > Do you have any idea whom or where to

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

2017-07-18 Thread Rhodri James
On 18/07/17 16:27, Dennis Lee Bieber wrote: On Tue, 18 Jul 2017 10:38:48 -0400, Random832 declaimed the following: Define "native" then. My interpretation of "native English words" is "anything you wouldn't have to put in italics to use in a sentence". Which would also include "continuum".

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

2017-07-18 Thread Rhodri James
On 18/07/17 15:10, Rustom Mody wrote: On Monday, July 17, 2017 at 10:14:00 PM UTC+5:30, Rhodri James wrote: On 17/07/17 05:10, Rustom Mody wrote: Hint1: Ask your grandmother whether unicode's notion of character makes sense. Ask 10 gmas from 10 language-L's Hint2: When in doubt gma usually is r

Re: cPickle fails on manually compiled and executed Python function

2017-07-18 Thread Jan Gosmann
On 07/18/2017 01:07 AM, dieter wrote: "Jan Gosmann" writes: [...] fn = load_pyfile('fn.py')['fn'] [...] "pickle" (and "cpickle") are serializing functions as so called "global"s, i.e. as a module reference together with a name. This means, they cannot handle functions computed in a module (as

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

2017-07-18 Thread Grant Edwards
On 2017-07-18, Steve D'Aprano wrote: > (I don't think any native English words use a double-V or double-U, but the > possibility exists.) double-v: flivver, navvy, bivvy, bevvy, trivvet, divvy, skivvy, skivvies, etc. and various gerund and past tense verbs: revved, revving, chivved ch

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

2017-07-18 Thread Random832
On Tue, Jul 18, 2017, at 10:23, Anders Wegge Keller wrote: > På Tue, 18 Jul 2017 23:59:33 +1000 > Chris Angelico skrev: > > On Tue, Jul 18, 2017 at 11:11 PM, Steve D'Aprano > >> (I don't think any native English words use a double-V or double-U, but > >> the possibility exists.) > > > vacuum.

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

2017-07-18 Thread Random832
On Sun, Jul 16, 2017, at 01:37, Steven D'Aprano wrote: > In a *well-designed* *bug-free* monospaced font, all code points should > be either zero-width or one column wide. Or two columns, if the font > supports East Asian fullwidth characters. What about Emoji? U+1F469 WOMAN is two columns wide

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

2017-07-18 Thread Anders Wegge Keller
På Tue, 18 Jul 2017 23:59:33 +1000 Chris Angelico skrev: > On Tue, Jul 18, 2017 at 11:11 PM, Steve D'Aprano >> (I don't think any native English words use a double-V or double-U, but >> the possibility exists.) > vacuum. That's latin. -- //Wegge -- https://mail.python.org/mailman/listi

Re: Combining every pair of list items and creating a new list.

2017-07-18 Thread ast
a écrit dans le message de news:621ca9d5-79b1-44c9-b534-3ad1b0cf4...@googlegroups.com... Hi, I'm having difficulty thinking about how to do this as a Python beginner. But I have a list that is represented as: [1,2,3,4,5,6,7,8] and I would like the following results: [1,2] [3,4] [5,6] [7,8

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

2017-07-18 Thread Rustom Mody
On Monday, July 17, 2017 at 10:14:00 PM UTC+5:30, Rhodri James wrote: > On 17/07/17 05:10, Rustom Mody wrote: > > Hint1: Ask your grandmother whether unicode's notion of character makes > > sense. > > Ask 10 gmas from 10 language-L's > > Hint2: When in doubt gma usually is right > > "For every co

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

2017-07-18 Thread Random832
On Fri, Jul 14, 2017, at 04:15, Marko Rauhamaa wrote: > Consider, for example, a Python source code > editor where you want to limit the length of the line based on the > number of characters more typically than based on the number of pixels. Even there you need to go based on the width in charac

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

2017-07-18 Thread Random832
On Fri, Jul 14, 2017, at 08:33, Chris Angelico wrote: > What do you mean about regular expressions? You can use REs with > normalized strings. And if you have any valid definition of "real > character", you can use it equally on an NFC-normalized or > NFD-normalized string than any other. They're j

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

2017-07-18 Thread Chris Angelico
On Tue, Jul 18, 2017 at 11:11 PM, Steve D'Aprano wrote: > On Tue, 18 Jul 2017 08:01 am, Mikhail V wrote: > >> And just in case still its not clear: this is not >> solved by adding dirt around the letter: if there is >> enough significance of the phoneme distinction then >> one should add a distinc

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

2017-07-18 Thread Steve D'Aprano
On Tue, 18 Jul 2017 08:01 am, Mikhail V wrote: > And just in case still its not clear: this is not > solved by adding dirt around the letter: if there is > enough significance of the phoneme distinction then > one should add a distinct letter for a syntax in question. It isn't "dirt", any more th

Re: Users of namedtuple: do you use the _source attribute?

2017-07-18 Thread Steve D'Aprano
On Tue, 18 Jul 2017 03:58 pm, Terry Reedy wrote: >> On Monday, July 17, 2017 at 12:20:04 PM UTC-5, Steve D'Aprano wrote: >>> collections.namedtuple generates a new class using exec, >>> and records the source code for the class as a _source >>> attribute. Although it has a leading underscore, it

Re: Funding continuous maintenance for PyInstaller?

2017-07-18 Thread Rhodri James
On 18/07/17 11:01, Hartmut Goebel wrote: Hi, I'm seeking advice how to fund continuous maintenance for an open source project. *Do you have any idea how to fund continuous maintenance for PyInstaller? Do you have any idea whom or where to ask? Do you know somebody to help setting up a commercia

How Can I edit and update my .config (for my python application) file using WebSockets exactly like how we edit and update router .config file?

2017-07-18 Thread T Obulesu
I have my python application running on Raspberry Pi and it needs to be configured every time. Hence I want to access this .config file over online and configure it exactly like how we can configure our router, but I want to use only web sockets. -- https://mail.python.org/mailman/listinfo/pyth

Funding continuous maintenance for PyInstaller?

2017-07-18 Thread Hartmut Goebel
Hi, I'm seeking advice how to fund continuous maintenance for an open source project. *Do you have any idea how to fund continuous maintenance for PyInstaller? Do you have any idea whom or where to ask? Do you know somebody to help setting up a commercial support/maintenance model? * I'm the (re

Re: Combining every pair of list items and creating a new list.

2017-07-18 Thread Rahul K P
You can use a simple logic and list comprehension. so it will be like this lst = [1, 2, 3, 4, 5, 6, 7, 8] print [lst[i:i+2] for i in range(0,len(lst),2)] Here 2 is the pairing number, You can set is as your need. On Tue, Jul 18, 2017 at 1:40 AM, wrote: > Hi, > > I'm having difficulty thinki

Re: Users of namedtuple: do you use the _source attribute?

2017-07-18 Thread Cameron Simpson
On 18Jul2017 02:57, Steve D'Aprano wrote: collections.namedtuple generates a new class using exec, and records the source code for the class as a _source attribute. Although it has a leading underscore, it is actually a public attribute. The leading underscore distinguishes it from a named fiel