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)) # <
"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
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.
--
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
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
I'm very confusing on the the differences between json.dumps and
json.loads. Any hints?
--
https://mail.python.org/mailman/listinfo/python-list
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?
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
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
> 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
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
14 matches
Mail list logo