Re: Convert pandas series to string and datetime object

2017-09-21 Thread MRAB
On 2017-09-21 20:27, zljubi...@gmail.com wrote: I have sliced the pandas dataframe end_date = df[-1:]['end'] type(end_date) Out[4]: pandas.core.series.Series end_date Out[3]: 48173 2017-09-20 04:47:59 Name: end, dtype: datetime64[ns] 1. How to get rid of index value 48173 and get only

[issue31452] asyncio.gather does not cancel tasks if one fails

2017-09-21 Thread Yury Selivanov
Yury Selivanov added the comment: I looked at the PR, and I'm not so sure about this change. In short, it can be viewed as a backwards incompatible change to asyncio.gather. Guido, what do you think? -- nosy: +gvanrossum ___ Python tracker

[issue31539] asyncio.sleep may sleep less time then it should

2017-09-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't think the bug is about real time here, rather about minimal sleep time expectations; i.e. it's expected that the sleep time may be *more* than asked for, but not less than. (and I would share that expectation myself) --

[issue31539] asyncio.sleep may sleep less time then it should

2017-09-21 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- versions: +Python 3.7 ___ Python tracker ___ ___

[issue31539] asyncio.sleep may sleep less time then it should

2017-09-21 Thread STINNER Victor
STINNER Victor added the comment: IMHO we should either just close the issue, ir document the bad clock resolution on Windows in the asyncio doc. Yury: asyncio can trigger events earlier than scheduled for performance reasons. See end_time in asyncio core loop. --

[issue31549] test_strptime and test_time fail on non-English Windows

2017-09-21 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: test_strptime and test_time fail on non-English Windows. For example: == FAIL: test_localtime_timezone (test.test_time.TestPytime)

[issue31539] asyncio.sleep may sleep less time then it should

2017-09-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 21/09/2017 à 23:31, STINNER Victor a écrit : > > Yury: asyncio can trigger events earlier than scheduled for performance > reasons. If that's true, then it sounds like a bug. If there is a rationale for a "fast and imprecise" API, then it would seem ok to

[issue31539] asyncio.sleep may sleep less time then it should

2017-09-21 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +gvanrossum ___ Python tracker ___ ___ Python-bugs-list

[issue26103] Contradiction in definition of "data descriptor" between (dotted lookup behavior/datamodel documentation) and (inspect lib/descriptor how-to)

2017-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The only question is remained -- should *data descriptors* be *descriptors*? I.e. is the __get__ method required for data descriptors? -- ___ Python tracker

[issue31548] test_os fails on Windows if current directory contains spaces

2017-09-21 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: I just have built Python on Windows first time and ran tests. test_os fails because the current directory path contains spaces. test_spawnl (test.test_os.SpawnTests) ... C:\Users\Serhiy: can't open file 'Storchaka\py\cpython\PCBuild\win32\python.exe':

[issue30346] Odd behavior when unpacking `itertools.groupby`

2017-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ping. Can you make your decision Raymond? This issue is a stopper for issue30347 which fixes a crash. I don't want to merge the fix for issue30347 until this issue be solved, because both proposed PRs solve issue30347 too, and I don't want to make unneeded

[issue31544] gettext.Catalog title is not flagged as a class

2017-09-21 Thread Éric Araujo
Éric Araujo added the comment: Are you talking about https://docs.python.org/3/library/gettext.html#the-catalog-constructor ? I think the lack of markup is on purpose, since the text explains that this is a compatibility measure (mostly obsolete nowadays). For future bug reports, please

[issue31092] multiprocessing.Manager() race condition

2017-09-21 Thread Prof Plum
Changes by Prof Plum : -- title: Potential multiprocessing.Manager() race condition -> multiprocessing.Manager() race condition ___ Python tracker

[issue31153] Update docstrings of itertools functions

2017-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For groupby() see also issue27385. -- ___ Python tracker ___ ___

[issue31543] Optimize wrapper descriptors using FASTCALL

2017-09-21 Thread STINNER Victor
STINNER Victor added the comment: The most complex slots are __new__, __init__ and __call__ because they accept keywords. It's hard to design a calling convention which optimize all cases because of the backward compatibility. The risk is to convert a dict to args + kwnames (tuple) and then back

[issue31539] asyncio.sleep may sleep less time then it should

2017-09-21 Thread STINNER Victor
STINNER Victor added the comment: Issues: - bpo-20320 - bpo-20452 - bpo-20505 - bpo-20311 The performance issue was that the asyncio core loop was running in a loop but did nothing because of time rounding. When the next event was in a few nanoseconds, the e event burnt the CPU during seconds.

[issue31543] Optimize wrapper descriptors using FASTCALL

2017-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: These slots are the only slots that accept keyword arguments and arbitrary number of positional parameters. Other slots can use fast calls. -- ___ Python tracker

Re: [Tutor] beginning to code

2017-09-21 Thread Bill
Stefan Ram wrote: Bill writes: Stefan Ram wrote: bartc writes: On 20/09/2017 02:31, Bill wrote: it's implementation, I would say that C++ has it all over Python from the point of view of "intuitiveness". It's much easier to tell what's going on,

Re: Convert pandas series to string and datetime object

2017-09-21 Thread Peter Otten
zljubi...@gmail.com wrote: > I have sliced the pandas dataframe > > end_date = df[-1:]['end'] > > type(end_date) > Out[4]: pandas.core.series.Series > > end_date > Out[3]: > 48173 2017-09-20 04:47:59 > Name: end, dtype: datetime64[ns] > > 1.How to get rid of index value 48173 and get

[issue31539] asyncio.sleep may sleep less time then it should

2017-09-21 Thread Yury Selivanov
Yury Selivanov added the comment: > it's expected that the sleep time may be *more* than asked for, but not less > than. Exactly, and asyncio tries to ensure that. It looks like "time.get_clock_info('monotonic').resolution" lies about monotonic clock resolution on Windows so that might be

[issue31539] asyncio.sleep may sleep less time then it should

2017-09-21 Thread Yury Selivanov
Yury Selivanov added the comment: So here's the relevant piece of code: end_time = self.time() + self._clock_resolution while self._scheduled: handle = self._scheduled[0] if handle._when >= end_time: break handle =

[issue31539] asyncio.sleep may sleep less time then it should

2017-09-21 Thread Yury Selivanov
Yury Selivanov added the comment: > The performance issue was that the asyncio core loop was running in a loop but did nothing because of time rounding. When the next event was in a few nanoseconds, the e event burnt the CPU during seconds. It can be 15 ms on Windows or 1 ms when using poll()

Re: Old Man Yells At Cloud

2017-09-21 Thread Rick Johnson
On Thursday, September 21, 2017 at 10:12:25 AM UTC-5, Steve D'Aprano wrote: > [...] > And remember that the Python core developers feel your pain > too. They had to migrate a large code base (the Python std > library) from 2 to 3. They had to write the 2to3 > translator. And they have to maintain

[issue31452] asyncio.gather does not cancel tasks if one fails

2017-09-21 Thread Guido van Rossum
Guido van Rossum added the comment: I'm afraid I no longer have all the details of this design in my head, and I have no idea what the fix does (and no time to read up on everything). The OP says "If you do not await gather" -- what happens if you *do* await it? Do the tasks then get killed?

[issue31550] Inconsistent error message for TypeError with subscripting

2017-09-21 Thread Anthony Sottile
New submission from Anthony Sottile: There's a bit of history I don't understand and couldn't find the appropriate trail for. The original error message from the 2.6 era: $ python2.6 -c 0[0] Traceback (most recent call last): File "", line 1, in TypeError: 'int' object is unsubscriptable

[issue31539] asyncio.sleep may sleep less time then it should

2017-09-21 Thread STINNER Victor
STINNER Victor added the comment: Technically, asyncii cannot wait exactly 100 ms on Windows. It will be more likely a sleep between 100-15 ms and 100+15 ms. Real time is really a complex topic. CPython with its stop-the-world garbage collector are not designed for real time. --

Re: [Tutor] beginning to code

2017-09-21 Thread Bill
Stefan Ram wrote: Just as Python's »string[::-1]« appears "obfuscated" to readers who don't know Python. I understand string[::-1] after only studying python for a day or two (I've only been studying it for 2 weeks at this point). A student could study C++ for a semester or more and not

Re: Old Man Yells At Cloud

2017-09-21 Thread Rhodri James
On 19/09/17 19:31, bartc wrote: Can't you get around all those with things like sys.stdout.write? If so, what was the point of having a discrete print statement/function at all? Simplicity. It is much easier to explain to a beginner that print("Wombats are go!") will write something

Re: Easy way to get a list of tuples.

2017-09-21 Thread Frank Millman
"Sayth Renshaw" wrote in message news:cd4aa5c7-47ee-442b-945e-490b0674e...@googlegroups.com... Thanks Thomas yes you are right with append. I have tried it but just can't get it yet as append takes only 1 argument and I wish to give it 3. You have not showed us what you tried, but you are

[issue27541] Repr of collection's subclasses

2017-09-21 Thread STINNER Victor
STINNER Victor added the comment: Why using type.__name__ rather than type.__qualname__? -- nosy: +haypo ___ Python tracker ___

[issue31543] Optimize wrapper descriptors using FASTCALL

2017-09-21 Thread STINNER Victor
Changes by STINNER Victor : -- keywords: +patch pull_requests: +3674 stage: -> patch review ___ Python tracker ___

[issue5885] uuid.uuid1() is too slow

2017-09-21 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +3673 ___ Python tracker ___

Re: [Tutor] beginning to code

2017-09-21 Thread Rick Johnson
INADA Naoki wrote: > Rick Johnson wrote [...] > > Of course, allowing all objects to use the `==`, `!=` > > sugars makes perfect sense, but `<`, `>`, `<=`, `>=` are > > meaningless outside of numeric-ish types. > > Now you know why Python 3 was born! It's one of many > pitfalls in Python 2 fixed

Re: Easy way to get a list of tuples.

2017-09-21 Thread Thomas Jollans
On 2017-09-21 12:18, Sayth Renshaw wrote: > This is my closest code > > data = r.json() > > raceData = [] > > for item in data["RaceDay"]['Meetings'][0]['Races']: > raceDetails = item['RacingFormGuide']['Event']['Race'] > raceData += >

[issue31510] test_many_processes() of test_multiprocessing_spawn failed on x86-64 Sierra 3.x

2017-09-21 Thread STINNER Victor
STINNER Victor added the comment: test_many_processes() is made in two steps. The bug occurs at the second step which calls proc.terminate() on processes. Code of the test: @classmethod def _sleep_some(cls): time.sleep(100) @classmethod def _test_sleep(cls, delay):

[issue31376] test_multiprocessing_spawn randomly hangs AMD64 FreeBSD 10.x Shared 3.x

2017-09-21 Thread STINNER Victor
Changes by STINNER Victor : -- stage: -> resolved status: open -> closed ___ Python tracker ___

[issue31510] test_many_processes() of test_multiprocessing_spawn failed on x86-64 Sierra 3.x

2017-09-21 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +pitrou ___ Python tracker ___ ___

Re: [Tutor] beginning to code

2017-09-21 Thread Rick Johnson
Bill wrote: > Rick Johnson wrote: > > I think for most languages an intuitive syntax is not > > important -- C is such a language, Lisp is such a > > language, Perl is such a language, and there are many more > > -- but for Python, intuitiveness is very important. > > > I guess it depends on what

Re: Easy way to get a list of tuples.

2017-09-21 Thread Mark Lawrence via Python-list
On 21/09/2017 11:18, Sayth Renshaw wrote: Hi I have been toying with json and I particular area where I cannot get the desired result a list of tuples as my return. The json from the API is way to long but I don't think it will matter. .. hitting url data = r.json() for item in

[issue27541] Repr of collection's subclasses

2017-09-21 Thread STINNER Victor
STINNER Victor added the comment: > Because reprs of Python implementations of collection use a bare __name__. Ah, maybe this module should be updated to use qualified name with the name in repr()? > __qualname__ is used only in combination with __module__. I was thinking at module.qualname,

Re: Easy way to get a list of tuples.

2017-09-21 Thread Thomas Jollans
On 2017-09-21 12:38, Sayth Renshaw wrote: > Thanks Thomas yes you are right with append. I have tried it but just can't > get it yet as append takes only 1 argument and I wish to give it 3. > > I am really having trouble creating the groups of 3, since I am getting one > consistent stream. I

PyDev 6.0.0 Released

2017-09-21 Thread Fabio Zadrozny
PyDev 6.0.0 Release Highlights - *Important* PyDev now requires Java 8 and Eclipse 4.6 (Neon) onwards. - PyDev 5.2.0 is the last release supporting Eclipse 4.5 (Mars). - *Interpreter configuration* - The *list of packages* installed in the interpreter is shown in the IDE

[issue31544] gettext.Catalog title is not flagged as a class

2017-09-21 Thread linkid
New submission from linkid: In the ``gettext`` documentatino, in the title about the ``Catalog`` constructor, ``Catalog`` is not flagged as a class. -- assignee: docs@python components: Documentation messages: 302696 nosy: docs@python, linkid priority: normal severity: normal status:

[issue31543] Optimize wrapper descriptors using FASTCALL

2017-09-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: > First I would like to know if it's worth it I don't know. What's the point of optimizing `array.array.__len__(obj)`? People usually call `len(obj)` for that... -- nosy: +pitrou ___ Python tracker

Re: Re: errors with json.loads

2017-09-21 Thread john polo
On 9/20/2017 5:56 PM, John Gordon wrote: In john polo writes: JSONDecodeError: Expecting ':' delimiter: line 5 column 50 (char 161) ?json.loads says that the method is for deserializing "s", with "s" being a string,

[issue31529] IDLE: Add docstrings and tests for editor.py reload functions

2017-09-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: A good start, and big enough as it is, for the next big revision project ;-). -- versions: +Python 3.6 ___ Python tracker

[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2017-09-21 Thread Steve Dower
Steve Dower added the comment: You're right, we're missing this section of code: if (PyOS_InputHook != NULL) (void)(PyOS_InputHook)(); Since we just call it and ignore anything it does, it should be safe enough to add it immediately before the ReadConsoleW call (inside the

[issue31539] asyncio.sleep may sleep less time then it should

2017-09-21 Thread R. David Murray
R. David Murray added the comment: I can't reproduce this on a linux VM with 3.7 tip. I don't currently have a windows instance to test against. -- nosy: +r.david.murray ___ Python tracker

[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2017-09-21 Thread Henk-Jaap Wagenaar
Henk-Jaap Wagenaar added the comment: @serhiy.storchaka: review done. -- nosy: +Henk-Jaap Wagenaar ___ Python tracker ___

Re: errors with json.loads

2017-09-21 Thread Ned Batchelder
On 9/20/17 10:35 PM, Bill wrote: Ned Batchelder wrote: On 9/20/17 8:22 PM, Bill wrote: Apparenty an \xa0 byte corresponds to a "non-breaking space". What sort of white space characters are allowed in a json file ( tabs and newlines?)?  Just curious. These things can be looked up.  From

Re: Old Man Yells At Cloud

2017-09-21 Thread Steve D'Aprano
On Thu, 21 Sep 2017 08:19 pm, Rhodri James wrote: > (That's basically my gripe against print becoming a function in Python3. > It makes a lot of sense as has already been pointed out, but it breaks > every beginners tutorial.) Nobody made that decision lightly. It wasn't a spur of the moment

[issue31539] asyncio.sleep may sleep less time then it should

2017-09-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: AFAIR the Windows clock has a 15ms granularity, so I'm not really surprised. In other words, I don't think `asyncio.sleep` sleeps less than expected, but that it's the imprecision of time.time() which gives you that impression. What happens if you replace

[issue31539] asyncio.sleep may sleep less time then it should

2017-09-21 Thread STINNER Victor
STINNER Victor added the comment: Clocks is a very complex topic, especially when you care of portability. See my PEP 418. asyncio uses time.monotonic() clock to not be impacted when the system clock ("wall clock") is updated by the administrator or automatically by NTP. On Windows,

[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2017-09-21 Thread Lam Yuen Hei
Lam Yuen Hei added the comment: Attach python 3.5 call stack of the test script -- Added file: https://bugs.python.org/file47161/py35_call_stack.png ___ Python tracker

[issue31500] IDLE: Tiny font on HiDPI display

2017-09-21 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- pull_requests: +3675 ___ Python tracker ___ ___

The Signature Module for PySide2

2017-09-21 Thread Christian Tismer
Hi friends, there is the new signature module for PySide2. It adds the __signature__ attribute to all PySide2 functions and constructors. Example usage: >>> PySide2.QtWidgets.QGraphicsAnchorLayout.addAnchors.__signature__ >>> PySide2.QtWidgets.QGraphicsAnchorLayout.__signature__ will print all

PyDev 6.0.0 Released

2017-09-21 Thread Fabio Zadrozny
PyDev 6.0.0 Release Highlights - *Important* PyDev now requires Java 8 and Eclipse 4.6 (Neon) onwards. - PyDev 5.2.0 is the last release supporting Eclipse 4.5 (Mars). - *Interpreter configuration* - The *list of packages* installed in the interpreter is shown in the IDE

Re: Re: errors with json.loads

2017-09-21 Thread john polo
On 9/20/2017 6:40 PM, Dennis Lee Bieber wrote: On Wed, 20 Sep 2017 17:13:41 -0500, john polo declaimed the following: and the example code for reading the file is: file = open('books.json','r') What encoding is the file? I did a cut from your post into a file,

[issue31500] IDLE: Tiny font on HiDPI display

2017-09-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 0c4997f1919d8583353b12537a63dcbe7b9d280f by Terry Jan Reedy in branch '3.6': [3.6] bpo-31500: IDLE: Scale default fonts on HiDPI displays. (GH-3639) (#3686) https://github.com/python/cpython/commit/0c4997f1919d8583353b12537a63dcbe7b9d280f

New security-annou...@python.org mailing list

2017-09-21 Thread Barry Warsaw
I’m happy to announce the availability of a new mailing list, with the mission of providing security announcements to the Python community from the Python Security Response Team (PSRT): security-annou...@python.org You can sign up in the usual Mailman way:

[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2017-09-21 Thread Lam Yuen Hei
New submission from Lam Yuen Hei: Since python 3.6, PyOS_InputHook is not called when waiting for IO in Windows. This causes issues with GUI framework like tkinter that relys on PyOS_InputHook to handle user interaction. I attached a test script. When running the script with python 3.5, the

[issue30302] Improve .__repr__ implementation for datetime.timedelta

2017-09-21 Thread Utkarsh Upadhyay
Changes by Utkarsh Upadhyay : -- keywords: +patch pull_requests: +3677 stage: -> patch review ___ Python tracker ___

[issue31545] Fixing documentation for timedelta.

2017-09-21 Thread Utkarsh Upadhyay
Changes by Utkarsh Upadhyay : -- keywords: +patch pull_requests: +3676 stage: -> patch review ___ Python tracker ___

Re: Old Man Yells At Cloud

2017-09-21 Thread Rhodri James
On 21/09/17 16:12, Steve D'Aprano wrote: On Thu, 21 Sep 2017 08:19 pm, Rhodri James wrote: (That's basically my gripe against print becoming a function in Python3. It makes a lot of sense as has already been pointed out, but it breaks every beginners tutorial.) Nobody made that decision

[issue31545] Fixing documentation for timedelta.

2017-09-21 Thread Utkarsh Upadhyay
New submission from Utkarsh Upadhyay: There are some instances in the documentation of datetime where the repr of timedelta is mentioned, which was changed in bpo-30302. Am making a PR shortly to address them. -- assignee: docs@python components: Documentation messages: 302700 nosy:

[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2017-09-21 Thread Lam Yuen Hei
Lam Yuen Hei added the comment: Attach python 3.6 call stack of the test script -- Added file: https://bugs.python.org/file47162/py36_call_stack.png ___ Python tracker

Re: Re: errors with json.loads

2017-09-21 Thread john polo
On 9/20/2017 5:58 PM, Bill wrote: Interesting problem, John. I have probably even less experience with json than you do, so I'm taking this as an opportunity to learn with you. Suggestions: 1. Try your example with Python 2 rather than Python 3. Bill, Thanks for the reply. I wasn't sure

[issue31539] asyncio.sleep may sleep less time then it should

2017-09-21 Thread Mikhail Gerasimov
Mikhail Gerasimov added the comment: STINNER Victor, thanks for explanation! I don't know if this issue has practical disadvantages, but such behavior seems to be confusing, especially, since it can be reproduced with event_loop.time() and asyncio doc says nothing about resolution -

[issue31510] test_many_processes() of test_multiprocessing_spawn failed on x86-64 Sierra 3.x

2017-09-21 Thread STINNER Victor
STINNER Victor added the comment: test_many_processes() test was added by Antoine Pitrou in bpo-30589. This test was mentionned in bpo-30703. -- ___ Python tracker

[issue31180] test_multiprocessing_spawn hangs randomly

2017-09-21 Thread STINNER Victor
STINNER Victor added the comment: Same issue on PPC64LE Fedora 3.x: http://buildbot.python.org/all/builders/PPC64LE%20Fedora%203.x/builds/1406/steps/test/logs/stdio -- title: test_multiprocessing_spawn hangs randomly on x86 Windows7 3.6 and AMD64 FreeBSD 10.x Shared 3.x ->

Re: [Tutor] beginning to code

2017-09-21 Thread bartc
On 20/09/2017 02:31, Bill wrote: Rick Johnson wrote: I think for most languages an intuitive syntax is not important -- C is such a language, Lisp is such a language, Perl is such a language, and there are many more -- but for Python, intuitiveness is very important. I guess it depends on what

[issue31410] int.__repr__() is slower than repr()

2017-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 5e02c7826f9797fb3add79b608ef51f7a62b3e5a by Serhiy Storchaka in branch 'master': bpo-31410: Optimized calling wrapper and classmethod descriptors. (#3481) https://github.com/python/cpython/commit/5e02c7826f9797fb3add79b608ef51f7a62b3e5a

[issue27541] Repr of collection's subclasses

2017-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b3a77964ea89a488fc0e920e3db6d8477279f19b by Serhiy Storchaka in branch 'master': bpo-27541: Reprs of subclasses of some classes now contain actual type name. (#3631)

[issue31410] int.__repr__() is slower than repr()

2017-09-21 Thread STINNER Victor
STINNER Victor added the comment: Oh, nice optimization! I see that you reused the _PyMethodDef_RawFastCallDict() function that I added exactly for the same reason: prevent the creation of a temporary C function only created for a single call and then destroyed. -- nosy: +inada.naoki

Re: Easy way to get a list of tuples.

2017-09-21 Thread Sayth Renshaw
On Thursday, 21 September 2017 20:31:28 UTC+10, Thomas Jollans wrote: > On 2017-09-21 12:18, Sayth Renshaw wrote: > > This is my closest code > > > > data = r.json() > > > > raceData = [] > > > > for item in data["RaceDay"]['Meetings'][0]['Races']: > > raceDetails =

[issue31538] mailbox does not treat external factories the same

2017-09-21 Thread Henk-Jaap Wagenaar
Henk-Jaap Wagenaar added the comment: To me the documentation doesn't quite look right, in the case of no factory being passed, it runs: def __getitem__(self, key): """Return the keyed message; raise KeyError if it doesn't exist.""" if not self._factory: return

[issue31410] int.__repr__() is slower than repr()

2017-09-21 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2017-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could anyone please make review of the documentation? -- ___ Python tracker ___

[issue27541] Repr of collection's subclasses

2017-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Raymond. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue27541] Repr of collection's subclasses

2017-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Because reprs of Python implementations of collection use a bare __name__. __qualname__ is used only in combination with __module__. Using a single __qualname__ can be confused: foo.bar looks as a name bar in the module foo. Whether in reprs and error

[issue31543] Optimize wrapper descriptors using FASTCALL

2017-09-21 Thread STINNER Victor
New submission from STINNER Victor: Attached pull request adds a fastpath for wrapper descriptors to use the FASTCALL calling convention. It's a follow up of bpo-31410 and all my work on FASTCALL during Python 3.6 and 3.7 development cycles. Microbenchmark: ./python -m perf timeit -s 'import

[issue31532] Py_GetPath, Py_SetPath memory corruption due to mixed PyMem_New micex with PyMem_Raw_Free

2017-09-21 Thread Benjamin Peterson
Benjamin Peterson added the comment: New changeset 3d1e2ab584ed0175592b5be2a0bc98dc1723776a by Benjamin Peterson (nurelin) in branch 'master': bpo-31532: Fix memory corruption due to allocator mix (#3679) https://github.com/python/cpython/commit/3d1e2ab584ed0175592b5be2a0bc98dc1723776a

[issue31532] Py_GetPath, Py_SetPath memory corruption due to mixed PyMem_New micex with PyMem_Raw_Free

2017-09-21 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +3670 ___ Python tracker ___

Re: How to share class relationship representations?

2017-09-21 Thread dieter
Leam Hall writes: > On 09/19/2017 11:16 AM, Stefan Ram wrote: >> leam hall writes: >>> I'm working on designing the classes, sub-classes, and relationships in my >>> code. What is a good visual way to represent it so it can be stored in git >>> and shared

[issue31536] `make regen-all` triggers wholesale rebuild

2017-09-21 Thread STINNER Victor
STINNER Victor added the comment: I may do the backport, or ask the bot to do it. Right now I prefer to check if everything is fine on all CI. -- resolution: fixed -> status: closed -> open ___ Python tracker

[issue31536] `make regen-all` triggers wholesale rebuild

2017-09-21 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +zach.ware ___ Python tracker ___ ___

[issue31532] Py_GetPath, Py_SetPath memory corruption due to mixed PyMem_New micex with PyMem_Raw_Free

2017-09-21 Thread Benjamin Peterson
Benjamin Peterson added the comment: New changeset 88d0663005d258526496d1f8ee0acb7103c69e80 by Benjamin Peterson (Miss Islington (bot)) in branch '3.6': [3.6] closes bpo-31532: Fix memory corruption due to allocator mix (GH-3679) (#3681)

Assertions

2017-09-21 Thread Tobiah
Are these completely equivalent? def foo(thing): assert(thing > 0), "Thing must be greater than zero" def foo(thing): if not (thing > 0): raise AssertionError("Thing must be greater than zero") Other than the fact that the assertion can be turned off with -O? Thanks,

New security-annou...@python.org mailing list

2017-09-21 Thread Barry Warsaw
I’m happy to announce the availability of a new mailing list, with the mission of providing security announcements to the Python community from the Python Security Response Team (PSRT): security-annou...@python.org You can sign up in the usual Mailman way:

[issue31493] IDLE cond context: fix code update and font update timers

2017-09-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: The underlying issue is trying to coordinate two somewhat independent object systems (Python and Tcl). I don't know why the after loops were (apparently) stopped before #27099 and not after. The only difference I know of is the dropping of the reference to

[issue31546] PyOS_InputHook is not called when waiting for input() in Windows

2017-09-21 Thread Steve Dower
Steve Dower added the comment: (Belongs inside Parser/myreadline.c in the _PyOS_WindowsConsoleReadline function) -- ___ Python tracker ___

Re: errors with json.loads

2017-09-21 Thread Ned Batchelder
On 9/21/17 12:18 PM, john polo wrote: Bill, Thanks for the reply. I wasn't sure how to get Python 2 through the cmd or IPython, so I went through ArcGIS, but it's mostly the same result: >>> file = open('books.json','r') >>> text = file.read() >>> text = json.loads(text) After the

[ANN] PyInstaller 3.3

2017-09-21 Thread Hartmut Goebel
Hello, on behalf of the PyInstaller development team I'm happy to announce PyInstaller 3.3. Most important change for this release is the support for Python 3.6. http://www.pyinstaller.org Thanks for all those who contributed questions, bug-reports or pull-requests. === What it is ===

Re: [Tutor] beginning to code

2017-09-21 Thread Bill
Stefan Ram wrote: bartc writes: On 20/09/2017 02:31, Bill wrote: it's implementation, I would say that C++ has it all over Python from the point of view of "intuitiveness". It's much easier to tell what's going on, at a glance, in a C++ program. You're being serious, aren't

[issue31550] Inconsistent error message for TypeError with subscripting

2017-09-21 Thread Anthony Sottile
Changes by Anthony Sottile : -- keywords: +patch pull_requests: +3679 stage: -> patch review ___ Python tracker ___

Re: Old Man Yells At Cloud

2017-09-21 Thread Steve D'Aprano
On Fri, 22 Sep 2017 02:00 pm, Rick Johnson wrote: > I think it's grossly unfair to label those who's lives > have been up-ended by the backwards incompatible changes of > Python3 as "haters". Nobody, not one person, has ever had their life upended by Python 3. People have their lives upended

Re: Easy way to get a list of tuples.

2017-09-21 Thread Sayth Renshaw
> > > > Thanks Thomas yes you are right with append. I have tried it but just > > can't get it yet as append takes only 1 argument and I wish to give it 3. > > > You have not showed us what you tried, but you are probably missing a pair > of brackets. > > C:\Users\User>python > Python 3.6.0

Re: [Tutor] beginning to code

2017-09-21 Thread Bill
Stefan Ram wrote: Bill writes: I understand string[::-1] after only studying python for a day or two (I've only been studying it for 2 weeks at this point). A student could study C++ for a semester or more and not encounter templates until they studied data

Re: [Tutor] beginning to code

2017-09-21 Thread Bill
Stefan Ram wrote: Bill writes: "Essential Reference", and I would say that Python is definitely a bigger, and more complicated language than C++. In some aspects it has simpler syntax. But consider all of the ways that you can pass arguments to a function, for

[issue31452] asyncio.gather does not cancel tasks if one fails

2017-09-21 Thread Yury Selivanov
Yury Selivanov added the comment: > I'm afraid I no longer have all the details of this design in my head, and I > have no idea what the fix does (and no time to read up on everything). Let's say we have three tasks: t1, t2, t3. Then we use gather on them: await gather(t1, t2, t3) Let's

  1   2   >