Re: Return str to a callback raise a segfault if used in string formating

2017-10-13 Thread dieter
Thomas Jollans writes: > On 2017-10-13 11:07, Vincent Vande Vyvre wrote: >> Le 13/10/17 à 09:23, Chris Angelico a écrit : >>> On Fri, Oct 13, 2017 at 4:46 PM, Vincent Vande Vyvre > ... > If you have custom C code, it's likely that there is a memory management > problem there. It's not unusual for

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 2:46 PM, Steve D'Aprano wrote: > On Fri, 13 Oct 2017 09:47 pm, Marko Rauhamaa wrote: > >> "Peter J. Holzer" : >> >>> On 2017-10-13 05:28, Gregory Ewing wrote: Not only does "byte" not always mean "8 bits", but "char" isn't always short for "character"... >>> >>>

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Steve D'Aprano
On Fri, 13 Oct 2017 09:47 pm, Marko Rauhamaa wrote: > "Peter J. Holzer" : > >> On 2017-10-13 05:28, Gregory Ewing wrote: >>> Not only does "byte" not always mean "8 bits", but >>> "char" isn't always short for "character"... >> >> True. > > Well, it does, in my universe. That was cast in stone

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Grant Edwards
On 2017-10-14, Gregory Ewing wrote: > >> I doubt that either process is in widespread usage any longer as >> most manufacturers no incorporate a way to update the firmware of a >> device > > Magnetic core technology died out long before that, due to > inability to build machines that simulated arm

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Steve D'Aprano
On Sat, 14 Oct 2017 07:04 am, Peter J. Holzer wrote: > On 2017-10-13 15:28, Steve D'Aprano wrote: >> On Sat, 14 Oct 2017 01:30 am, Chris Angelico wrote: It's just a technique, like greying out certain menu options - clicking them will do nothing, but you won't get an error message and y

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Steve D'Aprano
On Sat, 14 Oct 2017 01:51 am, Chris Angelico wrote: > On Sat, Oct 14, 2017 at 1:32 AM, Steve D'Aprano > wrote: >> It seems to me that you're not talking about ROM at all, but ordinary RAM. >> Then what do you mean by "read only"? A block of memory with a flag that >> says "unprivileged processes

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Steve D'Aprano
On Sat, 14 Oct 2017 07:15 am, Peter J. Holzer wrote: > On 2017-10-13 15:11, alister wrote: >> On Sat, 14 Oct 2017 01:48:44 +1300, Gregory Ewing wrote: >>> Steve D'Aprano wrote: I wasn't questioning where the data came from, but how the compiler can write to READ ONLY MEMORY which might

Re: Python 2 -> 3, urllib.urlOpen

2017-10-13 Thread MRAB
On 2017-10-13 23:27, Irv Kalb wrote: One of the colleges where I teach has just moved from Python 2 to Python 3. I am in the process of converting my beginning Python class from Python 2 to Python 3. Everything has gone smoothly, until I just tried to convert some code that imports and uses

Re: Case Solution: Bratwurst, Beer and Business Planning for Growth at Wurstküche by Thomas Knapp, Jacqueline Orr

2017-10-13 Thread farjanaumme1
On Thursday, July 27, 2017 at 9:01:17 PM UTC+10, Case Solution & Analysis wrote: > Case Solution and Analysis of Bratwurst, Beer and Business: Planning for > Growth at Wurstküche by Thomas Knapp, Jacqueline Orr is available at a lowest > price, send email to casesolutionscentre(at)gmail(dot)com i

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Gregory Ewing
alister wrote: in the past for large quantitys the data in a ROM chip was part of the chip etching mask I know, I'm considering the masking process to be a kind of write operation. The Apollo lunar lander used a magnetic core store that was hard coded at the time it was "Woven" I doubt that

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Gregory Ewing
Steve D'Aprano wrote: For example, pressing delete when there is no text to delete should just silently do nothing. That's really just a matter of deciding what should count as an error and what shouldn't. You've decided that "pressing Delete when there's nothing to delete does nothing" is a re

Re: Python 2 -> 3, urllib.urlOpen

2017-10-13 Thread Thomas Jollans
On 14/10/17 00:27, Irv Kalb wrote: > One of the colleges where I teach has just moved from Python 2 to Python 3. > I am in the process of converting my beginning Python class from Python 2 to > Python 3. Everything has gone smoothly, until I just tried to convert some > code that imports and u

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-13 Thread Ben Bacarisse
Chris Angelico writes: > On Sat, Oct 14, 2017 at 8:42 AM, Ben Bacarisse wrote: >> Chris Angelico writes: >> >>> On Fri, Oct 13, 2017 at 10:14 AM, Ben Bacarisse >>> wrote: Chris Angelico writes: > I abbreviated that down to nothing, but since you ask, here's a really > REALLY sim

Re: Python 2 -> 3, urllib.urlOpen

2017-10-13 Thread boB Stepp
On Fri, Oct 13, 2017 at 5:27 PM, Irv Kalb wrote: > I've looked at the Python 3.6 documentation for urllib, and I see that > certain calls have been changed and others have been eliminated. But my eyes > glaze over trying to figure out what to use instead. > > My question is: Is there a simple

Python 2 -> 3, urllib.urlOpen

2017-10-13 Thread Irv Kalb
One of the colleges where I teach has just moved from Python 2 to Python 3. I am in the process of converting my beginning Python class from Python 2 to Python 3. Everything has gone smoothly, until I just tried to convert some code that imports and uses urllib.urlOpen to fetch data through an

Re: Running flask on AWS SAM

2017-10-13 Thread sohcahtoa82
On Thursday, October 12, 2017 at 9:20:11 PM UTC-7, Frustrated learner wrote: > Hello, > > I have a flask based application which i am able to run locally. > > $ python swagger_server/app.py > * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit) > > I am trying to port this over to aws. I h

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 9:02 AM, Grant Edwards wrote: > On 2017-10-13, Chris Angelico wrote: > > [regarding PHP vs Python capable web-hosting services] > >> Thing is, that's exactly the same for both languages these days. You >> can get cheap (even zero-dollar) hosting that's preconfigured to be

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-13 Thread Grant Edwards
On 2017-10-13, Chris Angelico wrote: [regarding PHP vs Python capable web-hosting services] > Thing is, that's exactly the same for both languages these days. You > can get cheap (even zero-dollar) hosting that's preconfigured to be > able to support either. There USED to be a difference, and ev

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 8:42 AM, Ben Bacarisse wrote: > Chris Angelico writes: > >> On Fri, Oct 13, 2017 at 10:14 AM, Ben Bacarisse wrote: >>> Chris Angelico writes: I abbreviated that down to nothing, but since you ask, here's a really REALLY simple run-down of how to use Heroku: >>>

Re: Heroku (was Re: Lies in education [was Re: The "loop and a half"])

2017-10-13 Thread Ben Bacarisse
Chris Angelico writes: > On Fri, Oct 13, 2017 at 10:14 AM, Ben Bacarisse wrote: >> Chris Angelico writes: >>> I abbreviated that down to nothing, but since you ask, here's a really >>> REALLY simple run-down of how to use Heroku: >> >> I think I see what you mean now. You meant no configuratio

Re: Running flask on AWS SAM

2017-10-13 Thread Frustrated learner
Any takers? -- https://mail.python.org/mailman/listinfo/python-list

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
On 13/10/2017 15:39, Steve D'Aprano wrote: On Fri, 13 Oct 2017 11:54 pm, Gregory Ewing wrote: Neil Cerutti wrote: I can tell at a glance if a parameter is expected to be modifiable just by looking at the function signature. The question is why doesn't anyone feel the need to be able to do th

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Peter J. Holzer
On 2017-10-13 15:11, alister wrote: > On Sat, 14 Oct 2017 01:48:44 +1300, Gregory Ewing wrote: >> Steve D'Aprano wrote: >>> I wasn't questioning where the data came from, but how the compiler can >>> write to READ ONLY MEMORY which might not even be in the same continent >>> as the compiler that g

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 6:32 AM, Peter J. Holzer wrote: > On 2017-10-13 14:51, Chris Angelico wrote: >> On Sat, Oct 14, 2017 at 1:32 AM, Steve D'Aprano >> wrote: >>> It seems to me that you're not talking about ROM at all, but ordinary RAM. >>> Then what do you mean by "read only"? A block of mem

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Peter J. Holzer
On 2017-10-13 15:28, Steve D'Aprano wrote: > On Sat, 14 Oct 2017 01:30 am, Chris Angelico wrote: >>> It's just a technique, like greying out certain menu options - clicking >>> them will do nothing, but you won't get an error message and you don't want >>> to allow them anyway, risking more seriou

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Peter J. Holzer
On 2017-10-13 14:51, Chris Angelico wrote: > On Sat, Oct 14, 2017 at 1:32 AM, Steve D'Aprano > wrote: >> It seems to me that you're not talking about ROM at all, but ordinary RAM. >> Then what do you mean by "read only"? A block of memory with a flag that >> says "unprivileged processes are prohib

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Neil Cerutti
On 2017-10-13, Steve D'Aprano wrote: > On Fri, 13 Oct 2017 11:54 pm, Gregory Ewing wrote: > >> Neil Cerutti wrote: >>> I can tell at a glance if a parameter is expected to be >>> modifiable just by looking at the function signature. >> >> The question is why doesn't anyone feel the need to be >>

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread ROGER GRAYDON CHRISTMAN
On Sat, Oct 14, 2017, Gregory Ewing wrote: > Message: 5 >Date: Sat, 14 Oct 2017 01:54:49 +1300 >From: Gregory Ewing >To: python-list@python.org >Subject: Re: Lies in education [was Re: The "loop and a half"] >Message-ID: >Content-Type: text/plain; charset=ISO-8859-1; format=flowed > >Neil Cerutti

Re: Python-list Digest, Vol 169, Issue 23

2017-10-13 Thread Steve D'Aprano
Hi Roger, Unfortunately you seem to have messed up the quoting (*and* the subject line, and the threading) for this post. The perils of replying to digests. I'll try to repair the worst of the misquoted text as I go, but if I accidentally attribute something I said to you, well, that's only becau

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Marko Rauhamaa
alister : > On Sat, 14 Oct 2017 01:48:44 +1300, Gregory Ewing wrote: >> I thought it would be fairly obvious that by "put it in read-only >> memory" I meant "arrange for it to be in a location that is read-only >> at run time". Obviously it can't be read-only at *compile* time, just >> as a physic

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
On 13/10/2017 16:33, Steve D'Aprano wrote: On Sat, 14 Oct 2017 01:30 am, Chris Angelico wrote: For a novice, seeing 'Segmentation fault (core dumped)' is better? Better than silently doing nothing? YES. Absolutely it is. Chris, you forget that for Bart, his user-base is only himself. If he

Re: unorderable types: list() > int()

2017-10-13 Thread Andrew Z
The answer is: The dict returns list - my mistake obviously. I think list.pop(0) is better for sanity than list[0]: Pos= [k,v for ...].pop(0) On Oct 13, 2017 00:23, "Andrew Z" wrote: > Hello, > pos = {"CLown":10,"BArbie":20} > I want to return integer (10) for the keyword that starts with

RE: Unable to run pip in Windows 10

2017-10-13 Thread Michael Cuddehe
Thank you!!! What finally worked.> py -m pip install pyperclip -Original Message- From: Terry Reedy [mailto:tjre...@udel.edu] Sent: Wednesday, October 11, 2017 1:00 PM To: python-list@python.org Subject: Re: Unable to run pip in Windows 10 On 10/11/2017 10:46 AM, Michael Cuddehe wro

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Steve D'Aprano
On Sat, 14 Oct 2017 01:30 am, Chris Angelico wrote: >> For a novice, seeing 'Segmentation fault (core dumped)' is better? > > Better than silently doing nothing? YES. Absolutely it is. Chris, you forget that for Bart, his user-base is only himself. If he programs his home-made system to silently

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Steve D'Aprano
On Sat, 14 Oct 2017 01:30 am, Chris Angelico wrote: >> It's just a technique, like greying out certain menu options - clicking >> them will do nothing, but you won't get an error message and you don't want >> to allow them anyway, risking more serious consequences. > > Even there, you often CAN g

EuroPython 2017: Videos for Wednesday available online

2017-10-13 Thread M.-A. Lemburg
We are pleased to announce the third batch of cut videos for EuroPython 2017. To see the new videos, please head over to our EuroPython YouTube channel and select the “EuroPython 2017″ playlist. The new videos start at entry 63 in the playlist. * EuroPython 2017 Videos *

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
On 13/10/2017 15:59, Julien Salort wrote: Le 12/10/2017 à 17:57, bartc a écrit : With a const struct, you are stopped from directly modifying elements, but if an element is a pointer, nothing stops you writing to what the pointer points to, unless that has a const target too. And then you've

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread alister via Python-list
On Sat, 14 Oct 2017 01:48:44 +1300, Gregory Ewing wrote: > Steve D'Aprano wrote: >> I wasn't questioning where the data came from, but how the compiler can >> write to READ ONLY MEMORY which might not even be in the same continent >> as the compiler that generated the code. > > I thought it would

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Julien Salort
Le 12/10/2017 à 17:57, bartc a écrit : With a const struct, you are stopped from directly modifying elements, but if an element is a pointer, nothing stops you writing to what the pointer points to, unless that has a const target too. And then you've going to have problems doing normal updates

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 1:32 AM, Steve D'Aprano wrote: > It seems to me that you're not talking about ROM at all, but ordinary RAM. > Then what do you mean by "read only"? A block of memory with a flag that > says "unprivileged processes are prohibited from writing here"? > > (That's also not a rh

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Steve D'Aprano
On Fri, 13 Oct 2017 11:54 pm, Gregory Ewing wrote: > Neil Cerutti wrote: >> I can tell at a glance if a parameter is expected to be >> modifiable just by looking at the function signature. > > The question is why doesn't anyone feel the need to be > able to do that for Python functions? Whether a

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Steve D'Aprano
On Fri, 13 Oct 2017 11:48 pm, Gregory Ewing wrote: > Steve D'Aprano wrote: >> I wasn't questioning where the data came from, but how the compiler can >> write to READ ONLY MEMORY which might not even be in the same continent as >> the compiler that generated the code. > > I thought it would be fa

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Marko Rauhamaa
bartc : > But what about the poor user reading the code? Or can that now only be > done with the aid or a browser that analyses 100,000 lines and applies > that same algorithm? > > We mustn't forget the person writing the code, who may have a certain > type in mind for X, but their (I nearly said

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 12:51 AM, bartc wrote: > On 13/10/2017 14:16, Chris Angelico wrote: >> >> On Sat, Oct 14, 2017 at 12:00 AM, bartc wrote: >>> >>> Even if data is actually in write-protected memory, attempts to write to >>> it >>> will cause a crash. On my home-made system, they just did no

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
On 13/10/2017 14:22, Marko Rauhamaa wrote: BTW, the original reason for C requiring declarations in the first place wasn't readability. Rather, it was to make compilation possible in the first place. It is interesting that C++ and Java have taken steps to remove such information where the compil

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Marko Rauhamaa
Paul Moore : > To put it another way, in C const is a property of the variable being > declared, not the value assigned to it. In Python, variables aren't > declared, and constness is an inherent property of the value (or its > type). One interesting question which this does raise is whether > the

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Paul Moore
On 13 October 2017 at 13:54, Gregory Ewing wrote: > Neil Cerutti wrote: >> >> I can tell at a glance if a parameter is expected to be >> modifiable just by looking at the function signature. > > > The question is why doesn't anyone feel the need to be > able to do that for Python functions? Whethe

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
On 13/10/2017 14:16, Chris Angelico wrote: On Sat, Oct 14, 2017 at 12:00 AM, bartc wrote: Even if data is actually in write-protected memory, attempts to write to it will cause a crash. On my home-made system, they just did nothing. Much more graceful. The novice thinks his job is to stop the

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Marko Rauhamaa
Gregory Ewing : > Neil Cerutti wrote: >> I can tell at a glance if a parameter is expected to be modifiable >> just by looking at the function signature. > > The question is why doesn't anyone feel the need to be able to do that > for Python functions? Whether a function modifies things passed to

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Chris Angelico
On Sat, Oct 14, 2017 at 12:00 AM, bartc wrote: > Even if data is actually in write-protected memory, attempts to write to it > will cause a crash. On my home-made system, they just did nothing. Much more > graceful. The novice thinks his job is to stop the program from crashing. The expert knows

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
On 13/10/2017 12:49, Peter J. Holzer wrote: On 2017-10-13 10:37, Steve D'Aprano wrote: or written by a dedicated hardware device: https://en.wikipedia.org/wiki/Programmable_read-only_memory And in this case there will be a tool which will read the object file and send the contents of the r

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Gregory Ewing
Neil Cerutti wrote: I can tell at a glance if a parameter is expected to be modifiable just by looking at the function signature. The question is why doesn't anyone feel the need to be able to do that for Python functions? Whether a function modifies things passed to it is just as important to

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Gregory Ewing
Steve D'Aprano wrote: I wasn't questioning where the data came from, but how the compiler can write to READ ONLY MEMORY which might not even be in the same continent as the compiler that generated the code. I thought it would be fairly obvious that by "put it in read-only memory" I meant "arran

Re: Return str to a callback raise a segfault if used in string formating

2017-10-13 Thread Paul Moore
On 13 October 2017 at 12:18, Vincent Vande Vyvre wrote: > Le 13/10/17 à 12:39, Paul Moore a écrit : >> >> As a specific suggestion, I assume the name of the created file is a >> string object constructed in the C extension code, somehow. The fact >> that you're getting the segfault with some uses

Re: Return str to a callback raise a segfault if used in string formating

2017-10-13 Thread Vincent Vande Vyvre
Le 13/10/17 à 12:39, Paul Moore a écrit : As a specific suggestion, I assume the name of the created file is a string object constructed in the C extension code, somehow. The fact that you're getting the segfault with some uses of that string (specifically, passing it to %-formatting) suggests th

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Peter J. Holzer
On 2017-10-13 10:37, Steve D'Aprano wrote: > On Fri, 13 Oct 2017 05:16 pm, Gregory Ewing wrote: >> Steve D'Aprano wrote: >>> On Fri, 13 Oct 2017 03:37 pm, Gregory Ewing wrote: >>> If the compiler can tell where p is initially pointing, it could put the pointer in read-only memory. >>> >>

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Marko Rauhamaa
Marko Rauhamaa : > bartc : >> 'const' tries to do too many things, most of them poorly, although it >> does a very good job at adding clutter. > > +1 However, I do my best to honor "const" since it's there. I'm even more Catholic than the Pope and declare: int main(int argc, const char *const

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Marko Rauhamaa
"Peter J. Holzer" : > On 2017-10-13 05:28, Gregory Ewing wrote: >> Not only does "byte" not always mean "8 bits", but >> "char" isn't always short for "character"... > > True. Well, it does, in my universe. That was cast in stone 10**-32 seconds after the Big Bang. Marko -- https://mail.pyt

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Marko Rauhamaa
bartc : > 'const' tries to do too many things, most of them poorly, although it > does a very good job at adding clutter. +1 Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Steve D'Aprano
On Fri, 13 Oct 2017 05:16 pm, Gregory Ewing wrote: > Steve D'Aprano wrote: >> On Fri, 13 Oct 2017 03:37 pm, Gregory Ewing wrote: >> >>>If the compiler can tell where p is initially pointing, it could >>>put the pointer in read-only memory. >> >> If it's read-only, how can the compiler write to i

Re: Return str to a callback raise a segfault if used in string formating

2017-10-13 Thread Paul Moore
As a specific suggestion, I assume the name of the created file is a string object constructed in the C extension code, somehow. The fact that you're getting the segfault with some uses of that string (specifically, passing it to %-formatting) suggests that there's a bug in the C code that construc

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
On 13/10/2017 07:16, Gregory Ewing wrote: Steve D'Aprano wrote: On Fri, 13 Oct 2017 03:37 pm, Gregory Ewing wrote: If the compiler can tell where p is initially pointing, it could put the pointer in read-only memory. If it's read-only, how can the compiler write to it? (I come from the days

Re: Return str to a callback raise a segfault if used in string formating

2017-10-13 Thread Thomas Jollans
On 2017-10-13 11:07, Vincent Vande Vyvre wrote: > Le 13/10/17 à 09:23, Chris Angelico a écrit : >> On Fri, Oct 13, 2017 at 4:46 PM, Vincent Vande Vyvre >> wrote: >>> Simplified code: >>> >>> ---%<-- >>> ... >>> ---%<--

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Peter J. Holzer
On 2017-10-13 05:28, Gregory Ewing wrote: > Grant Edwards wrote: >> On 2017-10-13, Stefan Ram wrote: >>> 1 byte >>> >>> addressable unit of data storage large enough to hold >>> any member of the basic character set of the execution >>> environment« >>> >>>ISO C standard >

Re: Return str to a callback raise a segfault if used in string formating

2017-10-13 Thread Vincent Vande Vyvre
Le 13/10/17 à 09:23, Chris Angelico a écrit : On Fri, Oct 13, 2017 at 4:46 PM, Vincent Vande Vyvre wrote: Simplified code: ---%<-- ... ---%<-- If I place self.callback() at the end of the func process that doesn't

Re: unorderable types: list() > int()

2017-10-13 Thread Peter Otten
Andrew Z wrote: > Hello, > pos = {"CLown":10,"BArbie":20} > I want to return integer (10) for the keyword that starts with "CL" > > > cl_ = [v for k, v in pos.items() if k.startswith('CL')] > cl_pos = cl_[0] > if cl_pos > 0: > >blah.. > > > There are 2 issues with the above: > a. ugly -

Re: Return str to a callback raise a segfault if used in string formating

2017-10-13 Thread Chris Angelico
On Fri, Oct 13, 2017 at 4:46 PM, Vincent Vande Vyvre wrote: > Simplified code: > > ---%<-- > class Foo: > tasks = [] > def process(self, *args): > # process with the file > # save result on disk with a new name > self.out_file

Re: OT Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread Christian Gollwitzer
Am 12.10.17 um 01:33 schrieb Chris Angelico: Yeah. The trouble is that this is a really REALLY bad way to design something. Have you seen a city that grew one house at a time, and had streets added to service those houses? Not good. I tend to disagree. Many European villages have been built th

Return str to a callback raise a segfault if used in string formating

2017-10-13 Thread Vincent Vande Vyvre
Simplified code: ---%<-- class Foo:     tasks = []     def process(self, *args):     # process with the file     # save result on disk with a new name     self.out_filename.write(.)     def run_multitasks(self):     while self.tasks: