Re: [Tutor] Do _all_ Python builtin methods/functions return "None" IF ...

2018-01-26 Thread Steven D'Aprano
On Fri, Jan 26, 2018 at 08:56:31PM -0600, boB Stepp wrote: > ... they are not designed to explicitly return something else? Yes. In the absence of an explicit return, all Python functions will return None. > The reason I ask is that I almost fell into the following trap: > > > py3: a_lst = [

[Tutor] Do _all_ Python builtin methods/functions return "None" IF ...

2018-01-26 Thread boB Stepp
... they are not designed to explicitly return something else? The reason I ask is that I almost fell into the following trap: py3: a_lst = [0, 1, 2] py3: b_lst = a_lst.append(3) py3: a_lst, b_lst ([0, 1, 2, 3], None) Instead of "None" I was expecting "[0, 1, 2, 3]". Obviously I have a GCE (Gr

Re: [Tutor] Simple flask app querying twitter keeps crashing.

2018-01-26 Thread Alan Gauld via Tutor
On 26/01/18 12:31, jimmy connelly wrote: > Hello I have a very simple Flask app for fetching tweets from twitter... > ... > It runs great for a number of hours then crashes. Caveat, I'm in a hurry and haven't looked at your code. But when things run fine for a long time then crash my first instinc

[Tutor] Simple flask app querying twitter keeps crashing.

2018-01-26 Thread jimmy connelly
Hello I have a very simple Flask app for fetching tweets from twitter... Its very simple https://twitter-happy-or-sad-b.herokuapp.com/ outputs the word "hello" and nothing else, https://twitter-happy-or-sad-b.herokuapp.com/subject-tweets/any text returns 100 tweets containg 'any text' or 100 twee