Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread Chris Angelico
On Fri, Aug 18, 2017 at 4:38 PM, Paul Rubin wrote: > John Nagle writes: >> Since, as someone pointed out, there was UTF-8 which had been >> run through an ASCII-type lower casing algorithm > > I spent a few minutes figuring out if some of the mysterious 0x81's > could be from ASCII-lower-casing s

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread Paul Rubin
John Nagle writes: > Since, as someone pointed out, there was UTF-8 which had been > run through an ASCII-type lower casing algorithm I spent a few minutes figuring out if some of the mysterious 0x81's could be from ASCII-lower-casing some Unicode combining characters, but the numbers didn't seem

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread Chris Angelico
On Fri, Aug 18, 2017 at 4:24 PM, John Nagle wrote: >I'm coming around to the idea that some of these snippets > have been previously mis-converted, which is why they make no sense. > Since, as someone pointed out, there was UTF-8 which had been > run through an ASCII-type lower casing algorith

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread John Nagle
On 08/17/2017 10:12 PM, Ian Kelly wrote: Here's some more 0x9d usage, each from a different data item: Guitar Pro, JamPlay, RedBana\\\'s Audition,\x9d Doppleganger\x99s The Lounge\x9d or Heatwave Interactive\x99s Platinum Life Country,\\" This one seems like a good hint since \x99 here looks

Re: Proposed new syntax

2017-08-17 Thread Paul Rubin
Steve D'Aprano writes: > For loops and comprehensions (in Python) are inherently procedural, Sure, and floating point arithmetic is inherently imprecise and doesn't follow the associative laws for either addition or multiplication. There are times when we have to be aware of those details. Usual

Re: Proposed new syntax

2017-08-17 Thread Pavol Lisy
On 8/17/17, Marko Rauhamaa wrote: > Pavol Lisy : > >> On 8/17/17, Gregory Ewing wrote: >>> I don't agree that the word "for" necessarily implies proceduralness. >> >> With this logic (I humbly think that) word "while" neither >> necessarilly implies proceduralness. > > I don't see the logic. > >

Re: Proposed new syntax

2017-08-17 Thread Ian Kelly
On Thu, Aug 17, 2017 at 11:05 PM, Steve D'Aprano wrote: > On Fri, 18 Aug 2017 06:28 am, Ian Kelly wrote: >> "while" implies a condition that is currently true and may at some >> point stop being true. To me, that sequentiality does imply >> proceduralness. > > For loops and comprehensions (in Pyth

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread Steve D'Aprano
On Fri, 18 Aug 2017 10:14 am, John Nagle wrote: > I'm cleaning up some data which has text description fields from > multiple sources. Some are are in UTF-8. Some are in WINDOWS-1252. > And some are in some other character set. So I have to examine and > sanity check each field in a database

Re: A question on modification of a list via a function invocation

2017-08-17 Thread Steve D'Aprano
On Thu, 17 Aug 2017 11:37 pm, Ben Bacarisse wrote: > What goes wrong when someone thinks of Python as passing by value but > the value of an expression is an object reference? Lots. Because even if people *think* about call by value where the value is an invisible reference to the actual value,

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread Ian Kelly
On Thu, Aug 17, 2017 at 9:46 PM, John Nagle wrote: >The 0x9d thing seems unrelated to the Polish names thing. 0x9d > shows up in the middle of English text that's otherwise ASCII. > Is this something that can appear as a result of cutting and > pasting from Microsoft Word? > >I'd like to

Re: Proposed new syntax

2017-08-17 Thread Steve D'Aprano
On Fri, 18 Aug 2017 06:28 am, Ian Kelly wrote: > On Thu, Aug 17, 2017 at 1:19 PM, Pavol Lisy wrote: >> On 8/17/17, Gregory Ewing wrote: >>> Steve D'Aprano wrote: If he wanted declarative semantics, why didn't he argue for declarative syntax like "select...where", instead of choosi

Re: Proposed new syntax

2017-08-17 Thread Steve D'Aprano
On Fri, 18 Aug 2017 01:11 am, Lew Pitcher wrote: > Marko Rauhamaa wrote: >> I guess we have C to blame for the redefinition of the word "for" in >> programmers' minds. > > Sorry, but that use of "for" was part of the programmer's lexicon well > before the invention of C. Computer languages have

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread John Nagle
On 08/17/2017 05:53 PM, Chris Angelico wrote:> On Fri, Aug 18, 2017 at 10:30 AM, John Nagle wrote: >> On 08/17/2017 05:14 PM, John Nagle wrote: >>> I'm cleaning up some data which has text description fields from >>> multiple sources. >> A few more cases: >> >> bytearray(b'\xe5\x81ukasz zm

Re: Call a class A method from a class B instance? Do I miss something?

2017-08-17 Thread Rick Johnson
jf...@ms4.hinet.net wrote: > I study some codes of a tutorial about tkinter > > [snip code] > > My question is that the object which was left by > callit(self.demoenter_callback, tag) is a callit instance, > and the method it calls is a DemoMainWindow's method. How > it is possible? Why would it _

Re: A question on modification of a list via a function invocation

2017-08-17 Thread Steve D'Aprano
On Thu, 17 Aug 2017 11:19 pm, Rustom Mody wrote: > What is called ‘call-by-object’ or ‘call-by-sharing’ etc is really an > acknowledgement of the fact that parameter passing in the OO world along with > permissible mutation of data-structures is inherently leaky Leaky of *what*? What do you thi

Re: Call a class A method from a class B instance? Do I miss something?

2017-08-17 Thread Ian Kelly
On Thu, Aug 17, 2017 at 6:03 PM, wrote: > I study some codes of a tutorial about tkinter > (https://github.com/daleathan/widget-tour-py3) and can't figure out how it > works. > > Below is the codes from its two major files: > > # file infrastructure.py > ... > ... >

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread Ian Kelly
On Thu, Aug 17, 2017 at 8:15 PM, MRAB wrote: > On 2017-08-18 01:53, Chris Angelico wrote: >> So here's an insane theory: something attempted to lower-case the byte >> stream as if it were ASCII. If you ignore the high bit, 0xC5 looks >> like 0x45 or "E", which lower-cases by having 32 added to it,

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread MRAB
On 2017-08-18 01:30, John Nagle wrote: On 08/17/2017 05:14 PM, John Nagle wrote: > I'm cleaning up some data which has text description fields from > multiple sources. A few more cases: bytearray(b'miguel \xe3\x81ngel santos') bytearray(b'lidija kmeti\xe4\x8d') bytearray(b'\xe5\x81ukasz

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread MRAB
On 2017-08-18 01:53, Chris Angelico wrote: On Fri, Aug 18, 2017 at 10:30 AM, John Nagle wrote: On 08/17/2017 05:14 PM, John Nagle wrote: I'm cleaning up some data which has text description fields from multiple sources. A few more cases: bytearray(b'\xe5\x81ukasz zmywaczyk') This one

Re: Proposed new syntax

2017-08-17 Thread Chris Angelico
On Fri, Aug 18, 2017 at 11:13 AM, Steve D'Aprano wrote: > Within a single language, it is common to have both procedural and declarative > statements. E.g. in Python for statements are clearly procedural flow control. > But "import" can be read as a declarative statement: > > "Load this module, I

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread MRAB
On 2017-08-18 01:14, John Nagle wrote: I'm cleaning up some data which has text description fields from multiple sources. Some are are in UTF-8. Some are in WINDOWS-1252. And some are in some other character set. So I have to examine and sanity check each field in a database dump, deciding

Re: Proposed new syntax

2017-08-17 Thread Steve D'Aprano
On Thu, 17 Aug 2017 10:47 pm, Gregory Ewing wrote: > Steve D'Aprano wrote: >> Do you consider: >> >> for foo in bar: >> if baz(foo): >> f(foo) # append to a list, or print, or yield, as needed >> >> declarative? > > No. But the reason for that is not because it has the word > "for"

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread Ben Bacarisse
John Nagle writes: > I'm cleaning up some data which has text description fields from > multiple sources. Some are are in UTF-8. Some are in WINDOWS-1252. > And some are in some other character set. So I have to examine and > sanity check each field in a database dump, deciding which characte

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread Ian Kelly
On Thu, Aug 17, 2017 at 6:53 PM, Chris Angelico wrote: > That doesn't work for everything, though. The 0x81 0x81 and 0x9d ones > are still a puzzle. I'm fairly sure that b'M\x81\x81\xfcnster' is 'Münster'. It decodes to that in Latin-1 if you remove the \x81 bytes. The question then is what those

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread Chris Angelico
On Fri, Aug 18, 2017 at 10:54 AM, Ian Kelly wrote: > On Thu, Aug 17, 2017 at 6:52 PM, Ian Kelly wrote: >> On Thu, Aug 17, 2017 at 6:30 PM, John Nagle wrote: >>> A few more cases: >>> >>> bytearray(b'miguel \xe3\x81ngel santos') >> >> If that were b'\xc3\x81' it would be Á in UTF-8 which would fi

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread Ian Kelly
On Thu, Aug 17, 2017 at 6:52 PM, Ian Kelly wrote: > On Thu, Aug 17, 2017 at 6:30 PM, John Nagle wrote: >> A few more cases: >> >> bytearray(b'miguel \xe3\x81ngel santos') > > If that were b'\xc3\x81' it would be Á in UTF-8 which would fit the > rest of the name. > >> bytearray(b'\xe5\x81ukasz zmy

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread Ian Kelly
On Thu, Aug 17, 2017 at 6:30 PM, John Nagle wrote: > A few more cases: > > bytearray(b'miguel \xe3\x81ngel santos') If that were b'\xc3\x81' it would be Á in UTF-8 which would fit the rest of the name. > bytearray(b'\xe5\x81ukasz zmywaczyk') If that were b'\xc5\x81' it would be Ł in UTF-8 which

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread Chris Angelico
On Fri, Aug 18, 2017 at 10:30 AM, John Nagle wrote: > On 08/17/2017 05:14 PM, John Nagle wrote: >> I'm cleaning up some data which has text description fields from >> multiple sources. > A few more cases: > > bytearray(b'\xe5\x81ukasz zmywaczyk') This one has to be Polish, and the first char

Re: Cross-language comparison: function map and similar

2017-08-17 Thread Steve D'Aprano
On Thu, 17 Aug 2017 03:54 pm, Pavol Lisy wrote: > Is it guaranteed in python? Or future version could implement map with > something like subscriptability "propagation"? > range(1_000_000_000_000_000_000)[-1] > > map(lambda a:a+1,range(1_000_000_000_000_000_000))[-1] >

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread Ian Kelly
On Thu, Aug 17, 2017 at 6:27 PM, Chris Angelico wrote: > On Fri, Aug 18, 2017 at 10:14 AM, John Nagle wrote: >> I'm cleaning up some data which has text description fields from >> multiple sources. Some are are in UTF-8. Some are in WINDOWS-1252. >> And some are in some other character set. S

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread John Nagle
On 08/17/2017 05:14 PM, John Nagle wrote: > I'm cleaning up some data which has text description fields from > multiple sources. A few more cases: bytearray(b'miguel \xe3\x81ngel santos') bytearray(b'lidija kmeti\xe4\x8d') bytearray(b'\xe5\x81ukasz zmywaczyk') bytearray(b'M\x81\x81\xfcnster'

Re: What extended ASCII character set uses 0x9D?

2017-08-17 Thread Chris Angelico
On Fri, Aug 18, 2017 at 10:14 AM, John Nagle wrote: > I'm cleaning up some data which has text description fields from > multiple sources. Some are are in UTF-8. Some are in WINDOWS-1252. > And some are in some other character set. So I have to examine and > sanity check each field in a databa

What extended ASCII character set uses 0x9D?

2017-08-17 Thread John Nagle
I'm cleaning up some data which has text description fields from multiple sources. Some are are in UTF-8. Some are in WINDOWS-1252. And some are in some other character set. So I have to examine and sanity check each field in a database dump, deciding which character set best represents what's

Call a class A method from a class B instance? Do I miss something?

2017-08-17 Thread jfong
I study some codes of a tutorial about tkinter (https://github.com/daleathan/widget-tour-py3) and can't figure out how it works. Below is the codes from its two major files: # file infrastructure.py ... ... class callit: def __init__(self, function, *args ):

Re: Proposed new syntax

2017-08-17 Thread Ian Kelly
On Thu, Aug 17, 2017 at 1:19 PM, Pavol Lisy wrote: > On 8/17/17, Gregory Ewing wrote: >> Steve D'Aprano wrote: >>> If he wanted declarative semantics, why didn't he argue for declarative >>> syntax >>> like "select...where", instead of choosing procedural syntax which matches >>> the >>> actual p

Re: Proposed new syntax

2017-08-17 Thread Marko Rauhamaa
Pavol Lisy : > On 8/17/17, Gregory Ewing wrote: >> I don't agree that the word "for" necessarily implies proceduralness. > > With this logic (I humbly think that) word "while" neither > necessarilly implies proceduralness. I don't see the logic. Here's a random page from an algebra textbook:

Synchronization Primitives in Python

2017-08-17 Thread Sam Chats
A good introductory article on synchronizing threads in Python: https://hackernoon.com/synchronization-primitives-in-python-564f89fee732 -- https://mail.python.org/mailman/listinfo/python-list

Re: Proposed new syntax

2017-08-17 Thread Pavol Lisy
On 8/17/17, Gregory Ewing wrote: > Steve D'Aprano wrote: >> If he wanted declarative semantics, why didn't he argue for declarative >> syntax >> like "select...where", instead of choosing procedural syntax which matches >> the >> actual procedural semantics given? > > I don't agree that the word "

Re: Proposed new syntax

2017-08-17 Thread Lew Pitcher
Marko Rauhamaa wrote: > Gregory Ewing : >> I don't agree that the word "for" necessarily implies proceduralness. > > Programming languages stole the word from math, where it is > nonprocedural. > > Really, "for" is just a preposition. In Algol, for example, > proceduralness was not in the word "

Re: The tragic tale of the deadlocking Python queue

2017-08-17 Thread Terry Reedy
On 8/17/2017 4:31 AM, breamore...@gmail.com wrote: I found it interesting, possibly some of you may feel the same way so here it is https://codewithoutrules.com/2017/08/16/concurrency-python/ The intro ends with "Weep when you read the response of Python’s maintainers!", referring to https://

Re: Proposed new syntax

2017-08-17 Thread Rustom Mody
On Thursday, August 17, 2017 at 8:13:24 PM UTC+5:30, Marko Rauhamaa wrote: > Gregory Ewing : > > I don't agree that the word "for" necessarily implies proceduralness. > > Programming languages stole the word from math, where it is > nonprocedural. > > Really, "for" is just a preposition. In Algol

Re: Proposed new syntax

2017-08-17 Thread Marko Rauhamaa
Gregory Ewing : > I don't agree that the word "for" necessarily implies proceduralness. Programming languages stole the word from math, where it is nonprocedural. Really, "for" is just a preposition. In Algol, for example, proceduralness was not in the word "for" but in "do": for p := 1 step

Re: The tragic tale of the deadlocking Python queue

2017-08-17 Thread Chris Angelico
On Thu, Aug 17, 2017 at 6:31 PM, wrote: > I found it interesting, possibly some of you may feel the same way so here it > is https://codewithoutrules.com/2017/08/16/concurrency-python/ Starts out with a false premise. """ Writing programs with concurrency, programs with multiple threads, is ha

The tragic tale of the deadlocking Python queue

2017-08-17 Thread breamoreboy
I found it interesting, possibly some of you may feel the same way so here it is https://codewithoutrules.com/2017/08/16/concurrency-python/ Kindest regards. Mark Lawrence. -- https://mail.python.org/mailman/listinfo/python-list

Re: A question on modification of a list via a function invocation

2017-08-17 Thread Ben Bacarisse
Steve D'Aprano writes: > On Thu, 17 Aug 2017 10:14 am, Ned Batchelder wrote: >> For some reason, students have been taught that things can be either >> call-by-reference or call-by-value. But those are not the only two >> possibilities, and neither completely describes how Python works. That's

Re: A question on modification of a list via a function invocation

2017-08-17 Thread Rustom Mody
On Thursday, August 17, 2017 at 6:49:19 AM UTC+5:30, Mok-Kong Shen wrote: > Am 17.08.2017 um 02:41 schrieb Steve D'Aprano: > > On Thu, 17 Aug 2017 08:29 am, Mok-Kong Shen wrote: > > > >> I have earlier learned some other (older) programming languages. For > >> these the formal parameters are eithe

Re: Proposed new syntax

2017-08-17 Thread Rustom Mody
On Thursday, August 17, 2017 at 5:51:45 PM UTC+5:30, Gregory Ewing wrote: > Steve D'Aprano wrote: > > If he wanted declarative semantics, why didn't he argue for declarative > > syntax > > like "select...where", instead of choosing procedural syntax which matches > > the > > actual procedural sem

Re: Proposed new syntax

2017-08-17 Thread Gregory Ewing
Steve D'Aprano wrote: Do you consider: for foo in bar: if baz(foo): f(foo) # append to a list, or print, or yield, as needed declarative? No. But the reason for that is not because it has the word "for" in it. The reason is that it's made up of statements. Statements are procedur

Re: A question on modification of a list via a function invocation

2017-08-17 Thread Steve D'Aprano
On Thu, 17 Aug 2017 10:02 pm, Stefan Ram wrote: > r...@zedat.fu-berlin.de (Stefan Ram) writes: >>Python uses a reference-counting memory reclaimer, so the >>reference count of the OEBEA now is 2. > > IIRC, the reference-counting memory reclaimer (RCMC) is not > required by the language specif

Re: Proposed new syntax

2017-08-17 Thread Gregory Ewing
Steve D'Aprano wrote: If he wanted declarative semantics, why didn't he argue for declarative syntax like "select...where", instead of choosing procedural syntax which matches the actual procedural semantics given? I don't agree that the word "for" necessarily implies proceduralness. -- Greg -

Re: Why is my class undefined?

2017-08-17 Thread alister via Python-list
On Wed, 16 Aug 2017 18:02:48 -0700, Sayth Renshaw wrote: > On Thursday, 17 August 2017 09:03:59 UTC+10, Ian wrote: > wrote: >> > Morning >> > >> > I haven't ventured into classes much before. When trying to follow >> > some examples and create my own classes in a jupyter notebook I >> > receive

Re: A question on modification of a list via a function invocation

2017-08-17 Thread Chris Angelico
On Thu, Aug 17, 2017 at 6:25 PM, Larry Hudson via Python-list wrote: > On 08/17/2017 12:18 AM, Larry Hudson wrote: >> >> On 08/16/2017 03:39 PM, Chris Angelico wrote: >>> >>> On Thu, Aug 17, 2017 at 8:29 AM, Mok-Kong Shen > > ... > Oops, I replied to Chris's post, but it was meant for the OP. I s

Re: A question on modification of a list via a function invocation

2017-08-17 Thread Larry Hudson via Python-list
On 08/17/2017 12:18 AM, Larry Hudson wrote: On 08/16/2017 03:39 PM, Chris Angelico wrote: On Thu, Aug 17, 2017 at 8:29 AM, Mok-Kong Shen ... Oops, I replied to Chris's post, but it was meant for the OP. I should have replied to Mok-Kong Shen's post instead. My bad. Sorry for the confusion,

Re: Cross-language comparison: function map and similar

2017-08-17 Thread Chris Angelico
On Thu, Aug 17, 2017 at 3:54 PM, Pavol Lisy wrote: > On 8/16/17, Steve D'Aprano wrote: >> Over in another thread, we've been talking about comprehensions and their >> similarities and differences from the functional map() operation. >> >> Reminder: >> >> map(chr, [65, 66, 67, 68]) >> >> will retu

Re: A question on modification of a list via a function invocation

2017-08-17 Thread Larry Hudson via Python-list
On 08/16/2017 03:39 PM, Chris Angelico wrote: On Thu, Aug 17, 2017 at 8:29 AM, Mok-Kong Shen wrote: I have earlier learned some other (older) programming languages. For these the formal parameters are either "by reference" or "by value". In the first case, any modification of the formal paramet