Re: (Not actually off-topic) Anyone here used Rebol or Red?

2018-05-19 Thread Steven D'Aprano
On Sat, 19 May 2018 14:38:22 +, Steven D'Aprano wrote: > I'm looking for anyone with experience using either Rebol or its more > modern fork, Red. > > And yes, it is relevant to Python. Never mind, the Timbot has answered my question on the Python-Ideas list, so we're all good. -- Steve

Re: "Data blocks" syntax specification draft

2018-05-19 Thread Chris Angelico
On Sun, May 20, 2018 at 12:58 PM, Mikhail V wrote: > I have made up a printable PDF with the current version > of the syntax suggestion. > > https://github.com/Mikhail22/Documents/blob/master/data-blocks-v01.pdf > > After some of your comments I've made some further > re-considerations, e.g. eleme

"Data blocks" syntax specification draft

2018-05-19 Thread Mikhail V
I have made up a printable PDF with the current version of the syntax suggestion. https://github.com/Mikhail22/Documents/blob/master/data-blocks-v01.pdf After some of your comments I've made some further re-considerations, e.g. element separation should be now much simpler. A lot of examples with

Re: decorat{or,ion}

2018-05-19 Thread Mike McClain
On Sat, May 19, 2018 at 07:22:28AM +, Steven D'Aprano wrote: > On Fri, 18 May 2018 18:31:16 -0700, Mike McClain wrote: > > I *think* you are describing something like this: Real close! > def foo(x): > return x + 1 > > def bar(arg): > a = baz(arg) # do some magic > result = bar(a)

Re: what does := means simply?

2018-05-19 Thread bartc
On 20/05/2018 01:39, Dennis Lee Bieber wrote: On Sat, 19 May 2018 23:14:08 +0100, bartc declaimed the following: The comments and examples here: https://en.wikipedia.org/wiki/Netpbm_format, and all actual ppm files I've come across, suggest the 3 parts of the header (2 parts for P1/P4) are on

Re: decorat{or,ion}

2018-05-19 Thread Mike McClain
On Sat, May 19, 2018 at 08:22:59AM +0200, dieter wrote: > Mike McClain writes: > > An "object", in general, is something that can have attributes > (holding the object state) and methods (defining often operations on > the object state but in some cases also general operations (not > related to t

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-19 Thread Skip Montanaro
As Chris indicated, you'll have to figure out the correct encoding. You might want to check out the chardet module (available on PyPI, I believe) and see if it can come up with a better guess. I imagine there are other encoding guessers out there. That's just one I'm familiar with. Skip -- https:

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-19 Thread Chris Angelico
On Sun, May 20, 2018 at 8:58 AM, wrote: > On Thursday, 29 January 2009 12:09:29 UTC-5, Anjanesh Lekshminarayanan wrote: >> > It does auto-detect it as cp1252- look at the files in the traceback and >> > you'll see lib\encodings\cp1252.py. Since cp1252 seems to be the wrong >> > encoding, try ope

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-05-19 Thread bellcanadardp
On Thursday, 29 January 2009 12:09:29 UTC-5, Anjanesh Lekshminarayanan wrote: > > It does auto-detect it as cp1252- look at the files in the traceback and > > you'll see lib\encodings\cp1252.py. Since cp1252 seems to be the wrong > > encoding, try opening it as utf-8 or latin1 and see if that fixe

Re: what does := means simply?

2018-05-19 Thread bartc
On 19/05/2018 20:47, Dennis Lee Bieber wrote: On Sat, 19 May 2018 13:28:41 +0100, bartc declaimed the following: Out of interest, how would Python handle the headers for binary file formats P4, P5, P6? I'd have a go but I don't want to waste half the day trying to get past the language.

Re: what does := means simply?

2018-05-19 Thread MRAB
On 2018-05-19 13:28, bartc wrote: On 19/05/2018 12:38, Chris Angelico wrote: On Sat, May 19, 2018 at 8:33 PM, bartc wrote: But then you are acknowledging the file is, in fact, ASCII. Cool! So what happens if you acknowledge that a file is ASCII, and then it starts with a byte value of E3 ?

Re: TypeError: expected string or Unicode object, NoneType found

2018-05-19 Thread Terry Reedy
On 5/19/2018 12:47 PM, Peter Otten wrote: subhabangal...@gmail.com wrote: I wrote a small piece of following code import nltk from nltk.corpus.reader import TaggedCorpusReader from nltk.tag import CRFTagger To implement Peter's suggestion: def NE_TAGGER(): def tagger(stop): reader

Re: TypeError: expected string or Unicode object, NoneType found

2018-05-19 Thread Peter Otten
subhabangal...@gmail.com wrote: > I wrote a small piece of following code > > import nltk > from nltk.corpus.reader import TaggedCorpusReader > from nltk.tag import CRFTagger > def NE_TAGGER(): > reader = TaggedCorpusReader('/python27/', r'.*\.pos') > f1=reader.fileids() > print "The

TypeError: expected string or Unicode object, NoneType found

2018-05-19 Thread subhabangalore
I wrote a small piece of following code import nltk from nltk.corpus.reader import TaggedCorpusReader from nltk.tag import CRFTagger def NE_TAGGER(): reader = TaggedCorpusReader('/python27/', r'.*\.pos') f1=reader.fileids() print "The Files of Corpus are:",f1 sents=reader.tagged_s

(Not actually off-topic) Anyone here used Rebol or Red?

2018-05-19 Thread Steven D'Aprano
I'm looking for anyone with experience using either Rebol or its more modern fork, Red. And yes, it is relevant to Python. -- Steve -- https://mail.python.org/mailman/listinfo/python-list

EuroPython 2018: Call for Proposals closes on Sunday

2018-05-19 Thread M.-A. Lemburg
We would like to remind you that our two week call for proposals (CFP) closes on Sunday, May 20. If you’d like to submit a talk, please see our CFP announcement for details: https://blog.europython.eu/post/173666124852/europython-2018-call-for-proposals-cfp-is-open Submissions are possibe via th

Re: what does := means simply?

2018-05-19 Thread bartc
On 19/05/2018 12:33, Peter J. Holzer wrote: On 2018-05-19 11:33:26 +0100, bartc wrote: Not you understand why some of us don't bother with 'text mode' files. "Not" or "Now"? Now. Yesterday you claimed that you worked with them for 40 years. Text files, yes. Not 'text mode' which is som

Re: what does := means simply?

2018-05-19 Thread bartc
On 19/05/2018 12:38, Chris Angelico wrote: On Sat, May 19, 2018 at 8:33 PM, bartc wrote: But then you are acknowledging the file is, in fact, ASCII. Cool! So what happens if you acknowledge that a file is ASCII, and then it starts with a byte value of E3 ? It depends. If this is a .ppm f

Re: what does := means simply?

2018-05-19 Thread Chris Angelico
On Sat, May 19, 2018 at 8:33 PM, bartc wrote: > On 19/05/2018 02:26, Chris Angelico wrote: >> >> On Sat, May 19, 2018 at 11:10 AM, bartc wrote: > > >>> The .ppm (really .pbm) file which was the subject of this sub-thread has >>> its >>> header defined using ASCII. I don't think an EBCDIC 'P4' etc

Re: what does := means simply?

2018-05-19 Thread Peter J. Holzer
On 2018-05-19 11:33:26 +0100, bartc wrote: > On 19/05/2018 02:26, Chris Angelico wrote: > > On Sat, May 19, 2018 at 11:10 AM, bartc wrote: > > > The .ppm (really .pbm) file which was the subject of this sub-thread has > > > its > > > header defined using ASCII. I don't think an EBCDIC 'P4' etc wi

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-19 Thread Peter J. Holzer
On 2018-05-19 11:38:09 +0300, Marko Rauhamaa wrote: > "Peter J. Holzer" : > > (I wonder whether the notion that “=” and “==” are easy to mix up > > stems from the early days of C when C was an outlier (most other > > languages at the time used “=” for equality). Now C is mainstream and > > it's tho

Re: what does := means simply?

2018-05-19 Thread bartc
On 19/05/2018 02:26, Chris Angelico wrote: On Sat, May 19, 2018 at 11:10 AM, bartc wrote: The .ppm (really .pbm) file which was the subject of this sub-thread has its header defined using ASCII. I don't think an EBCDIC 'P4' etc will work. "Defined using ASCII" is a tricky concept. There ar

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-19 Thread Marko Rauhamaa
"Peter J. Holzer" : > (I wonder whether the notion that “=” and “==” are easy to mix up > stems from the early days of C when C was an outlier (most other > languages at the time used “=” for equality). Now C is mainstream and > it's those other languages that seem odd.) I occasionally mix them up

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-19 Thread Peter J. Holzer
On 2018-05-16 01:26:38 +0100, bartc wrote: > On 15/05/2018 21:21, Peter J. Holzer wrote: > > I have been programming in C since the mid-80's and in Perl since the > > mid-90's (both languages allow assignment expressions). I accumulated my > > fair share of bugs in that time, but AFAIR I made this

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-19 Thread Peter J. Holzer
On 2018-05-16 00:04:06 +, Steven D'Aprano wrote: > On Tue, 15 May 2018 22:21:15 +0200, Peter J. Holzer wrote: > > On 2018-05-15 00:52:42 +, Steven D'Aprano wrote: > [...] > >> By 1991 there had already been *decades* of experience with C > > > > About one and a half decades. > > That woul

Re: decorat{or,ion}

2018-05-19 Thread Steven D'Aprano
On Fri, 18 May 2018 18:31:16 -0700, Mike McClain wrote: > Let's say I want something that does most or all of foo's functionality > plus a little more and maybe tweek some of foo's output, so I write a > wrapper around foo and call it bar. If inside bar are the call to foo, > as well as methods ba