Re: itertools product(infinite iterator) hangs

2019-09-13 Thread ast
Le 14/09/2019 à 04:26, Oscar Benjamin a écrit : I've been staring at this for a little while: from itertools import product class Naturals: def __iter__(self): i = 1 while True: yield i i += 1 N = Naturals() print(iter(N)) print(product(N)) # <

Re: TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-13 Thread tommy yama
"35 million lines of python code" it is insane. On Fri, Sep 13, 2019 at 9:39 PM Skip Montanaro wrote: > > > https://www.techrepublic.com/google-amp/article/jpmorgans-athena-has-35-million-lines-of-python-code-and-wont-be-updated-to-python-3-in-time/ > > I doubt this is unusual, and presume JP M

Re: Friday Finking: 'main-lines' are best kept short

2019-09-13 Thread boB Stepp
On Thu, Sep 12, 2019 at 10:59 PM DL Neil via Python-list wrote: > Ref: > Mastering Object-oriented Python, S Lott > Copyright © 2014 Packt Publishing Side note: When I looked this up I saw on Amazon that there is a second edition out targeting Python 3.7. It was published June of this year. --

itertools product(infinite iterator) hangs

2019-09-13 Thread Oscar Benjamin
I've been staring at this for a little while: from itertools import product class Naturals: def __iter__(self): i = 1 while True: yield i i += 1 N = Naturals() print(iter(N)) print(product(N)) # <--- hangs When I run the above the call to product han

Re: The differences between json.dumps and json.loads.

2019-09-13 Thread Cameron Simpson
On 14Sep2019 02:18, Hongyi Zhao wrote: I'm very confusing on the the differences between json.dumps and json.loads. Any hints? The direction. json.dumps takes an object and transcribes it as a string. "Dump to string." json.loads takes a string and decodes it as JSON and returns an object

The differences between json.dumps and json.loads.

2019-09-13 Thread Hongyi Zhao
I'm very confusing on the the differences between json.dumps and json.loads. Any hints? -- https://mail.python.org/mailman/listinfo/python-list

Re: what's the differences: None and null?

2019-09-13 Thread Random832
On Fri, Sep 13, 2019, at 21:22, Hongyi Zhao wrote: > what's the differences: None and null? null isn't really a concept that exists in Python... while None fills many of the same roles that null does in some other languages, it is a proper object, with __str__ and __repr__ methods (that return '

what's the differences: None and null?

2019-09-13 Thread Hongyi Zhao
what's the differences: None and null? -- https://mail.python.org/mailman/listinfo/python-list

Re: Friday Finking: 'main-lines' are best kept short

2019-09-13 Thread Cameron Simpson
On 13Sep2019 15:58, DL Neil wrote: Is it a good idea to keep a system's main-line* code as short as possible, essentially consigning all of 'the action' to application and external packages and modules? Generally yes. * my choice of term: "main-line", may be taken to mean: - the contents of

Re: Weird Python Bug

2019-09-13 Thread MRAB
On 2019-09-13 20:17, CrazyVideoGamez wrote: For some reason, if you put in the code def odd_ones_out(numbers): for num in numbers: count = numbers.count(num) if not count % 2 == 0: for i in range(count): numbers.remove(num) return numbers

RE: Weird Python Bug

2019-09-13 Thread David Raymond
2 comments: First: Deleting from a list while you're iterating over it is a bad idea. Your first iteration gives nums[0] which is 72. But then you delete that and (in effect) everything moves up. So now the 4 is in the nums[0] slot. Your second iteration returns nums[1] which is now the 82 mean

Weird Python Bug

2019-09-13 Thread CrazyVideoGamez
For some reason, if you put in the code def odd_ones_out(numbers): for num in numbers: count = numbers.count(num) if not count % 2 == 0: for i in range(count): numbers.remove(num) return numbers nums = [72, 4, 82, 67, 67] print(odd_ones_out(nums

Re: TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-13 Thread Skip Montanaro
> https://www.techrepublic.com/google-amp/article/jpmorgans-athena-has-35-million-lines-of-python-code-and-wont-be-updated-to-python-3-in-time/ I doubt this is unusual, and presume JP Morgan is big enough to handle the change of status, either by managing security releases in-house or relying on t

TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-13 Thread Larry Martell
https://www.techrepublic.com/google-amp/article/jpmorgans-athena-has-35-million-lines-of-python-code-and-wont-be-updated-to-python-3-in-time/ -- https://mail.python.org/mailman/listinfo/python-list