@hjwp Your answer proofs that my statement is not universally true (although I soon get lost in nested loops in comprehensions). When I was drafting up my reply, I was thinking more about cases like the following: https://t.co/gjbHUwhEXp
@hjwp Agree with map and filter (and your follow-up tweets), but a "readable" replacement would imply a variable that requires initialization and a loop in which it is continually updated. I consider reduce to be quite readable and canonical (https://t.co/Q14kFBQdiz)
@raymondh I'm working on a `BoolTuple` and `BoolList` in my (not so) copious free time, just for fun. Internal storage is `int` using bit logic and shift operators. Estimated Time of first release is yet completely unknown.
@muzurvelet@bascodes Probably because the `list` implementation of `+=` modifies the list instance in-place. See Python's `.__iadd__()` documentation, https://t.co/WeZykVZHBP. But `+=` doesn't _need_ to do this, it may also return a new object. The caller doesn't know, hence re-assigns `my_tuple[2]`.
@bascodes Yup, `TypeError` is raised. You can "fix" it by changing it to `my_tuple[2].extend(['C', 'D'])`. "Fix" between quotes because you should ask yourself whether modifying an item within an immutable container is a good thing.
@s_gruppetta_ct I remember vaguely having once read that `list` was implemented as a linear (C) array of PyObject pointers. Deleting from its start would imply memory-moves, that would lead me to "from left 1000x slower" (enter `collections.deque`)
@bbelderbos Finally, there's even a pylint plugin named `pylint_google_style_guide_imports_enforcing`, see https://t.co/62mpckwI4h. It works like a charm! 3/3
@bbelderbos This section also mentions some standard abbreviations, like `np` for `numpy`. I also abbreviate modules having objects with a name equal to the containing module. So I use `cp` for the `copy` module and `dt` for the `datetime` module. 2/3
I felt privileged to present my #talk "When to refactor your code into generators and how" 3 months ago at #EuroPython in Dublin. View the #video at https://t.co/bdREgOGvSw. Thx to all people making this #Python conf possible and to #Ordina for the opportunity to be present(ing).
Today we received reports of a phishing campaign targeting PyPI users. This is the first known phishing attack against PyPI.
We’re publishing the details here to raise awareness of what is likely an ongoing threat.
@reuvenmlerner This seems to be congruent with what the Python documentation glossary has to say about this: https://t.co/qdUeWwoI90 and https://t.co/XA5MQyxMJx.