Re: Checking whether type is None

2018-07-26 Thread Marko Rauhamaa
Steven D'Aprano : > On Wed, 25 Jul 2018 16:14:18 +, Schachner, Joseph wrote: >> thing is None looks just as odd to me. Why not thing == None ? That >> works. > > It is wrong (in other words, it doesn't work) because it allows > non-None objects to masquerade as None and pretend to be what they

[issue34229] Possible access to unintended variable in "cpython/Objects/sliceobject.c" line 116

2018-07-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You need to expose it in the _testcapi module as Python function. -- ___ Python tracker ___

[issue34229] Possible access to unintended variable in "cpython/Objects/sliceobject.c" line 116

2018-07-26 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Is there a way to test this or trigger this code using Python syntax? `slice(start, stop, step).indices()` uses slice_indices in Objects/sliceobject.c . I checked the function docs https://docs.python.org/2.7/c-api/slice.html#c.PySlice_GetIndices

Re: Cookies not showing up in environ

2018-07-26 Thread abc abc
Yes, this was the problem. At some point early in my attempts I got the idea that linking up Django to a production web server required writing a separate wsgi.py script. Wrong. Replaced the wsgi.py with the default Django wsgi.py for the project and everything seems resolved. Thank you. --

[issue34210] Small improvements in heapq (refactoring)

2018-07-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: Additional notes: * reversed() is preferred over the range(n-1, -1, -1) style both for clarity and speed. If reversed is slower, then it would be mean that something is sly wrong with range.__reversed__ which should be able to iterate backwards as

[issue34221] Any plans to combine collections.OrderedDict with dict

2018-07-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: See the related discussion on python-dev and other tracker entries where this was discussed previously. -- nosy: +rhettinger resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python

[issue34227] Weighted random.sample() (weighted sampling without replacement)

2018-07-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thank for the suggestion and patch, but I will decline. To me, the reseviour style algorithm doesn't fit in well (with the slow sorting step and the frequent calls to the random in the key function). For large population sizes (which sample() was

[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-07-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 6. hypot(x) == abs(x) 7. hypot(x, y) should return the same result as in previous Python version, e.g. should call C lib implementation. 8. hypot(x, y, 0, ...) == hypot(x, y) -- ___ Python tracker

[issue23794] http package should support HTTP/2

2018-07-26 Thread XiangSong Zeng
Change by XiangSong Zeng : -- nosy: +zengxs ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33089] Add multi-dimensional Euclidean distance function to the math module

2018-07-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think we should guarantee some properties: 1. The result of hypot(x, y, z, ...) shouldn't depend on the order of arguments. 2. It should be monotonic for all arguments: hypot(..., x, ...) <= hypot(..., y, ...) for abs(x) < abs(y). 3. hypot(..., inf,

[issue30271] Make sqlite3 statement cache optional

2018-07-26 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the report. What is your use case for making the statement caching optional? Did you notice any performance improvement when you use it with newer SQLite versions? -- stage: -> patch review versions: +Python 3.8 -Python 3.7

[issue32788] Better error handling in sqlite3

2018-07-26 Thread Berker Peksag
Change by Berker Peksag : -- pull_requests: -7998 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32788] Better error handling in sqlite3

2018-07-26 Thread Sergey Fedoseev
Change by Sergey Fedoseev : -- pull_requests: +7998 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

<    1   2