Re: [Tutor] Regex ^$ not behaving as expected

2016-12-08 Thread Edmund Butterworth via Tutor
asons I want to do this in Python. I can and shall now. Best regards Ed Original Message *Subject: *Re: [Tutor] Regex ^$ not behaving as expected *From: *Danny Yoo *To: *Edmund Butterworth *Cc: *Python Tutor Mailing List *Date: *08/12/2016, 17:20:19 Following up:

Re: [Tutor] Regex ^$ not behaving as expected

2016-12-08 Thread Danny Yoo
Following up: drats! Detecting this conceptual TypeError is not feasible under the current design, due to the choice of data representation used in this API. The reason is because the flags are being represented as integers, and we're using bitwise operations to define the union of flags. That i

Re: [Tutor] Regex ^$ not behaving as expected

2016-12-08 Thread Danny Yoo
> I'm still somewhat confused as to what the regexp module is doing when > passing a non-numeric count parameter. That looks like it should > raise a TypeError to me, so perhaps someone needs to file a bug > against the standard library? Unsure. Ok, I'm filing a bug to the Python developers so

Re: [Tutor] Regex ^$ not behaving as expected

2016-12-08 Thread Danny Yoo
Hi Edmund, For each of the cases that surprise you, next time, can you also say what you expected to see? That can help us see where the confusion lies; as it stands, if we have the same mental model as what's happening in Python, then the results look correct to us. :P I can guess at what you

[Tutor] Regex ^$ not behaving as expected

2016-12-08 Thread Edmund Butterworth via Tutor
Hello, I am new to Python and trying to get to grips with the re regex module. I’m running Python 3.4 under Debian Jessie with a Cinnamon desktop. My understanding is that when the re.M flag is raised, |^| will match at the beginning of the string and also at the beginning of each line withi