Re: List replication operator

2018-05-26 Thread Steven D'Aprano
On Fri, 25 May 2018 09:58:19 -0700, Rob Gaddi wrote: > I agree that it's non-obvious, but I disagree with your diagnosis. A further data point: "I was not properly appreciating that that these repeated objects were the *same identical* objects that were in the pre-replicated

Re: Why cannot I use __slots__ and weakrefs together?

2018-05-26 Thread Steven D'Aprano
On Sat, 26 May 2018 11:53:42 +0200, Christian Heimes wrote: >> Why does weakref hate my Eggs class? > > Weakref needs some place to store reference information. It works if you > add "__weakref__" to your slots: > > class Eggs: > __slots__ = ['spanish_inquisition', '__weakref__'] Thanks!

[issue32911] Doc strings no longer stored in body of AST

2018-05-26 Thread Nick Coghlan
Nick Coghlan added the comment: After looking at potential implementation approaches, I believe the following would be the ASDL code generator changes needed to present the docstring as part of the body in the Python API, while keeping it as a separate attribute in the C

[issue33651] Add get() method to sqlite3.Row class

2018-05-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: > But I hear Raymond's point about all field being known, > and I think that's a good point… and I agree I don't > actually need .get(). > Feel free to close. Thanks for the quick replies. Okay, done. -- resolution:

[issue33657] float addition rounding error

2018-05-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: The math hasn't changed. The underlying values haven't changed. What did change what that the __str__ now displays to full precision. Formerly, it used to display a rounded result that didn't reflect the actual stored value.

[issue33657] float addition rounding error

2018-05-26 Thread voidptr
New submission from voidptr : help in python 3.6.5 z = 1787.4 + 6.2 gives me z = 1793.6001 in python 2.7.15 gives z = 1793.6 I dont want explicitly round float thing every time so I went back to 2.7.15 -- components: Interpreter Core messages: 317779

[issue33657] float addition rounding error

2018-05-26 Thread Eitan Adler
Change by Eitan Adler : -- nosy: +eitan.adler ___ Python tracker ___ ___

[issue33651] Add get() method to sqlite3.Row class

2018-05-26 Thread Wilfredo Sanchez
Wilfredo Sanchez added the comment: Well, sequence and mapping are not mutually exclusive, and sqlite3.Row does allow mapping-style indexing, which is why I expected .get() to work. But I hear Raymond's point about all field being known, and I think that's a good

[issue32911] Doc strings no longer stored in body of AST

2018-05-26 Thread Nick Coghlan
Nick Coghlan added the comment: Just noting that I'm going to attempt an alternative, hopefully lower impact, approach at implementing the reversion, which will be to modify Parser/asdl_c.py to inject the following constructor postamble for ASDL nodes that define both a

Re: '_' and '__'

2018-05-26 Thread Ben Finney
Mike McClain writes: > Steven D'Aprano and Ben Finney used these '_' and '__'. > Steve said, "[[] for _ in range(5)]". > Ben said, "[ [] for __ in range(5) ]". > > These aren't listed separately in the index That's right, the names ‘_’ and ‘__’ have no special meaning

Re: '_' and '__'

2018-05-26 Thread Cameron Simpson
On 27May2018 09:46, Chris Angelico wrote: On Sun, May 27, 2018 at 9:40 AM, Thomas Jollans wrote: There's nothing special about _, it's just a possible name of a variable, albeit a very short and entirely uninformative one. Normally, it's not something you'd

Re: '_' and '__'

2018-05-26 Thread Chris Angelico
On Sun, May 27, 2018 at 9:40 AM, Thomas Jollans wrote: > On 27/05/18 01:19, Mike McClain wrote: >> In their discussion of 'List replication operator' >> Steven D'Aprano and Ben Finney used these '_' and '__'. >> Steve said, "[[] for _ in range(5)]". >> Ben said, "[ [] for __ in

Re: '_' and '__'

2018-05-26 Thread Thomas Jollans
On 27/05/18 01:19, Mike McClain wrote: > In their discussion of 'List replication operator' > Steven D'Aprano and Ben Finney used these '_' and '__'. > Steve said, "[[] for _ in range(5)]". > Ben said, "[ [] for __ in range(5) ]". > > These aren't listed separately in the index, where

[issue33656] IDLE: Turn on DPI awareness on Windows

2018-05-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: I changed the bare except: to 'except AttributeError:'. If ctypes.windll.shcore.SetProcessDpiAwareness exists, can calling it with True ever fail? -- ___ Python tracker

[issue33656] IDLE: Turn on DPI awareness on Windows

2018-05-26 Thread Terry J. Reedy
Change by Terry J. Reedy : -- keywords: +patch pull_requests: +6771 ___ Python tracker ___

'_' and '__'

2018-05-26 Thread Mike McClain
In their discussion of 'List replication operator' Steven D'Aprano and Ben Finney used these '_' and '__'. Steve said, "[[] for _ in range(5)]". Ben said, "[ [] for __ in range(5) ]". These aren't listed separately in the index, where might I find written discussion of these? Thanks, Mike

[issue33656] IDLE: Turn on DPI awareness on Windows

2018-05-26 Thread Terry J. Reedy
New submission from Terry J. Reedy : On IDLE-dev today, Elisha Paine, from Ranelagh School in England, wrote: ''' I love IDLE (so simple and lightweight compared with other IDEs) and was just wondering if you could add the following code into pyshell.py (as I have done on

Re: Raw string statement (proposal)

2018-05-26 Thread Mikhail V
On Sat, May 26, 2018 at 10:21 PM, Chris Angelico wrote: > > I'm done. Argue with brick walls for the rest of eternity if you like. I see you like me, but I can reciprocate your feelings. > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list --

[issue31931] test_concurrent_futures: ProcessPoolSpawnExecutorTest.test_shutdown_race_issue12456() leaked dangling process on x86 Tiger 3.x

2018-05-26 Thread Ned Deily
Ned Deily added the comment: Since the macOS Tiger buildbot has been retired, let's close this unless a similar failure pops up on another, more modern platform. -- nosy: +ned.deily resolution: -> out of date stage: -> resolved status: open -> closed

[issue32290] bolen-dmg-3.6: compilation failed with OSError: [Errno 23] Too many open files in system

2018-05-26 Thread Ned Deily
Ned Deily added the comment: The macOS Tiger buildbot where all of these "too many files open" OS failures occurred has been retired. -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker

[issue31106] os.posix_fallocate() generate exception with errno 0

2018-05-26 Thread Ned Deily
Ned Deily added the comment: P.S.: > Koobs, could you please open a new issue about the failing test? Unless > someone knows of a foolproof way to determine on all platforms that a file is > resident on ZFS, the fix is to skip the test on FreeBSD as well if ZFS is > likely

[issue33655] test_posix_fallocate fails on FreeBSD buildbots with ZFS file systems

2018-05-26 Thread Ned Deily
Ned Deily added the comment: Fix merged for 3.7.0 and 3.6.6. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue33655] test_posix_fallocate fails on FreeBSD buildbots with ZFS file systems

2018-05-26 Thread miss-islington
miss-islington added the comment: New changeset ae27dee0f8f364f0bbb170d918a28b87cd0753d9 by Miss Islington (bot) in branch '3.6': bpo-33655: Also ignore test_posix_fallocate failures on BSD platforms (GH-7134)

[issue33655] test_posix_fallocate fails on FreeBSD buildbots with ZFS file systems

2018-05-26 Thread miss-islington
miss-islington added the comment: New changeset 96fb828da305b18336b8d74b14f479c4f286cf7b by Miss Islington (bot) in branch '3.7': bpo-33655: Also ignore test_posix_fallocate failures on BSD platforms (GH-7134)

[issue33652] Improve pickling of typing types

2018-05-26 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Yes, these are just legacy from times when TypeVars were serialized by value, not by identity like now. I think it should be safe to remove them. Would you like to make a PR? -- ___ Python

[issue33400] logging.Formatter does not default to ISO8601 date format

2018-05-26 Thread Vinay Sajip
Vinay Sajip added the comment: Yes, sorry, Ned, I've been snowed under with other work recently :-( -- ___ Python tracker ___

[issue33652] Improve pickling of typing types

2018-05-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is a question -- what to do with all these __getstate__ and __setstate__ methods? They are part of the pickle protocol, but they are not used when define __reduce__. And they are not needed for supporting compatibility

Re: Some Issues on Tagging Text

2018-05-26 Thread Cameron Simpson
On 26May2018 04:02, Subhabrata Banerjee wrote: On Saturday, May 26, 2018 at 3:54:37 AM UTC+5:30, Cameron Simpson wrote: It sounds like you want a more general purpose parser, and that depends upon your purposes. If you're coding to learn the basics of breaking up

[issue32380] functools.singledispatch interacts poorly with methods

2018-05-26 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset c651275afe8515b2cf70b8152e19ce39df88f0dd by Łukasz Langa (Ethan Smith) in branch 'master': bpo-32380: Create functools.singledispatchmethod (#6306) https://github.com/python/cpython/commit/c651275afe8515b2cf70b8152e19ce39df88f0dd

[issue33655] test_posix_fallocate fails on FreeBSD buildbots with ZFS file systems

2018-05-26 Thread miss-islington
Change by miss-islington : -- pull_requests: +6770 ___ Python tracker ___

[issue33655] test_posix_fallocate fails on FreeBSD buildbots with ZFS file systems

2018-05-26 Thread miss-islington
Change by miss-islington : -- pull_requests: +6769 ___ Python tracker ___

[issue33655] test_posix_fallocate fails on FreeBSD buildbots with ZFS file systems

2018-05-26 Thread Ned Deily
Ned Deily added the comment: New changeset 09c4a7dee2eb39b515e5f499f184257cdbe9cb42 by Ned Deily in branch 'master': bpo-33655: Also ignore test_posix_fallocate failures on BSD platforms (GH-7134)

[issue33655] test_posix_fallocate fails on FreeBSD buildbots with ZFS file systems

2018-05-26 Thread Ned Deily
Change by Ned Deily : -- keywords: +patch pull_requests: +6768 ___ Python tracker ___ ___

[issue33655] test_posix_fallocate fails on FreeBSD buildbots with ZFS file systems

2018-05-26 Thread Ned Deily
New submission from Ned Deily : Seen on some of the various FreeBSD buildbots: == ERROR: test_posix_fallocate (test.test_posix.PosixTester) --

[issue32458] test_asyncio: test_start_tls_server_1() fails randomly

2018-05-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: I presume the above is using the month-old openssl-bin-1.1.0h. -- ___ Python tracker ___

[issue32458] test_asyncio: test_start_tls_server_1() fails randomly

2018-05-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: I have not seen test_asyncio fail on AppVeyor since about Sunday. https://ci.appveyor.com/project/python/cpython/history shows only a couple of failures, which could very well be real. I have seen test_asyncio fail on Travis since Sunday.

[issue32458] test_asyncio: test_start_tls_server_1() fails randomly

2018-05-26 Thread Christian Heimes
Christian Heimes added the comment: It's failing reproducible with OpenSSL 1.1.1 and TLS 1.3 enabled. I haven't seen it failing with TLS 1.2 yet. -- nosy: +christian.heimes ___ Python tracker

Re: Raw string statement (proposal)

2018-05-26 Thread Chris Angelico
On Sun, May 27, 2018 at 5:13 AM, Mikhail V wrote: > On Sat, May 26, 2018 at 7:10 PM, Steven D'Aprano >> temp = >>| Mikhail's syntax for {65290} is {65290} >> Can you see the problem yet? How does your collapse function f() >> distinguish between the escape code {65290}

Re: Raw string statement (proposal)

2018-05-26 Thread Mikhail V
On Sat, May 26, 2018 at 7:10 PM, Steven D'Aprano wrote: > On Sat, 26 May 2018 18:22:15 +0300, Mikhail V wrote: > >>> Here is a string assigned to name `s` using Python's current syntax: >>> >>> s = "some\ncharacters\0abc\x01\ndef\uFF0A\nhere" >>> >>> How do

[issue32458] test_asyncio: test_start_tls_server_1() fails randomly

2018-05-26 Thread Yury Selivanov
Yury Selivanov added the comment: > But in msg317468 Victor asserts that it sometimes fails on Linux, too? Hm, I missed that. I'll definitely take a look. -- ___ Python tracker

[issue32458] test_asyncio: test_start_tls_server_1() fails randomly

2018-05-26 Thread Ned Deily
Ned Deily added the comment: > Last time I looked into this I couldn't reproduce the failures on my Windows > 10 VM, so it seems like an AppVeyor-specific problem. I'll take another look > on Monday. But in msg317468 Victor asserts that it sometimes fails on Linux, too?

[issue13886] readline-related test_builtin failure

2018-05-26 Thread Xavier de Gaye
Xavier de Gaye added the comment: As stated in msg285810, issue 28180 removed the need for an Android workaround. After checking this point on the Android API 24 emulator with the current master branch, I have opened PR 7133 which is Martin's input-readline.v3.patch with

[issue33400] logging.Formatter does not default to ISO8601 date format

2018-05-26 Thread Ned Deily
Change by Ned Deily : -- versions: +Python 3.6, Python 3.7, Python 3.8 -Python 3.4 ___ Python tracker ___

[issue33400] logging.Formatter does not default to ISO8601 date format

2018-05-26 Thread Ned Deily
Ned Deily added the comment: Vinay, PR_6704, the 3.7 backport is still unmerged with review comments and there are unresolved comments here. Can we at least get the 3.7 branch in sync with the other branches while you sort this out one way or another? -- nosy:

[issue13886] readline-related test_builtin failure

2018-05-26 Thread Xavier de Gaye
Change by Xavier de Gaye : -- pull_requests: +6767 ___ Python tracker ___ ___

[issue32458] test_asyncio: test_start_tls_server_1() fails randomly

2018-05-26 Thread Yury Selivanov
Yury Selivanov added the comment: Last time I looked into this I couldn't reproduce the failures on my Windows 10 VM, so it seems like an AppVeyor-specific problem. I'll take another look on Monday. Andrew, if you have a Windows environment, could you please try to run

[issue23495] The writer.writerows method should be documented as accepting any iterable (not only a list)

2018-05-26 Thread Nathaniel Manista
Change by Nathaniel Manista : -- nosy: +Nathaniel Manista ___ Python tracker ___ ___

[issue21983] segfault in ctypes.cast

2018-05-26 Thread miss-islington
miss-islington added the comment: New changeset e60f6e1864d80d80f8928afadec617d161a64150 by Miss Islington (bot) in branch '3.7': bpo-21983: Fix a crash in ctypes.cast() when passed a ctypes structured data type (GH-3859)

[issue33652] Improve pickling of typing types

2018-05-26 Thread miss-islington
miss-islington added the comment: New changeset d49862582ed3513debed6e919fd4f92e9d4eebbd by Miss Islington (bot) in branch '3.7': bpo-33652: Improve pickle support in the typing module. (GH-7123)

[issue33652] Improve pickling of typing types

2018-05-26 Thread miss-islington
Change by miss-islington : -- pull_requests: +6766 ___ Python tracker ___

[issue33652] Improve pickling of typing types

2018-05-26 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset 09f3221fbbf72692308149054e4f7668b08b22eb by Ivan Levkivskyi (Serhiy Storchaka) in branch 'master': bpo-33652: Improve pickle support in the typing module. (GH-7123)

[issue32458] test_asyncio: test_start_tls_server_1() fails randomly

2018-05-26 Thread Ned Deily
Ned Deily added the comment: Yury, are you still planning to address this? -- ___ Python tracker ___

[issue33654] asyncio: transports don't support switching between Protocol and BufferedProtocol

2018-05-26 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks, Ned! -- ___ Python tracker ___ ___

[issue32769] Add 'annotations' to the glossary

2018-05-26 Thread Andrés Delfino
Change by Andrés Delfino : -- pull_requests: +6765 ___ Python tracker ___ ___

[issue32769] Add 'annotations' to the glossary

2018-05-26 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset 717204ffcccfe04a34b6c4a52f0e844fde3cdebe by Ivan Levkivskyi (Andrés Delfino) in branch '3.6': [3.6] bpo-32769: A new take on annotations/type hinting glossary entries (GH-6829) (GH-7128)

[issue33654] asyncio: transports don't support switching between Protocol and BufferedProtocol

2018-05-26 Thread Ned Deily
Ned Deily added the comment: LGTM for 3.7 -- priority: release blocker -> high ___ Python tracker ___

Re: Enums: making a single enum

2018-05-26 Thread Ethan Furman
On 05/26/2018 01:00 AM, Steven D'Aprano wrote: I wish there was a simpler way to define symbols with identity but no state or behaviour... Check out the Constant class in aenum. You still might want to customize the repr, though. -- ~Ethan~ --

[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-05-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Great idea! But the problem is that additional flags can be used, e.g. METH_CLASS. -- ___ Python tracker

[issue32769] Add 'annotations' to the glossary

2018-05-26 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset e69657df244135a232117f692640e0568b04e999 by Guido van Rossum (Andrés Delfino) in branch '3.7': [3.7] bpo-32769: A new take on annotations/type hinting glossary entries (GH-6829) (#7127)

[issue33653] EnvironmentError does not set errno unless strerror is set

2018-05-26 Thread Eryk Sun
Eryk Sun added the comment: This behavior is inherited from BaseException: https://docs.python.org/3/library/exceptions.html#BaseException >>> str(BaseException()) '' >>> str(BaseException('spam')) 'spam' >>> str(BaseException('spam', 'eggs'))

[issue33654] asyncio: transports don't support switching between Protocol and BufferedProtocol

2018-05-26 Thread Yury Selivanov
Yury Selivanov added the comment: Setting "release blocker" to get Ned's attention. -- priority: high -> release blocker ___ Python tracker

Re: Re: The PIL show() method looks for the default viewer. How do I change this to a different viewer (of my choice)?

2018-05-26 Thread Peter Otten
Paul St George wrote: > Thank you. > You are very right. The show() method is intended for debugging purposes > and is useful for that, but what method should I be using and is PIL the > best imaging library for my purposes? I do not want to manipulate > images, I only want to show images (full

[issue33654] asyncio: transports don't support switching between Protocol and BufferedProtocol

2018-05-26 Thread Yury Selivanov
Change by Yury Selivanov : -- keywords: +patch pull_requests: +6764 stage: -> patch review ___ Python tracker ___

[issue33654] asyncio: transports don't support switching between Protocol and BufferedProtocol

2018-05-26 Thread Yury Selivanov
New submission from Yury Selivanov : 1. asyncio.BufferedProtocol is a new Python 3.7 *provisional* API. 2. asyncio.Transport.set_protocol() doesn't support switching between Protocol and BufferedProtocol. 3. Because of (2), another *new* Python 3.7 API "loop.start_tls"

[issue15327] Argparse: main arguments and subparser arguments indistinguishable

2018-05-26 Thread paul j3
Change by paul j3 : -- nosy: +paul.j3 ___ Python tracker ___ ___ Python-bugs-list

Re: Raw string statement (proposal)

2018-05-26 Thread Steven D'Aprano
On Sat, 26 May 2018 18:22:15 +0300, Mikhail V wrote: >> Here is a string assigned to name `s` using Python's current syntax: >> >> s = "some\ncharacters\0abc\x01\ndef\uFF0A\nhere" >> >> How do you represent that assignment using your syntax? > > Hope its not mandatory to decipher your random

Re: Enums: making a single enum

2018-05-26 Thread Steven D'Aprano
On Sat, 26 May 2018 23:54:51 +1000, Chris Angelico wrote: > Seems pretty non-controversial, which means it's almost guaranteed to > reach 100+ posts debating what the name should be. Including: * 27 posts declaring that using such singleton symbols is completely un-Pythonic and is sure to

Re: Raw string statement (proposal)

2018-05-26 Thread Mikhail V
On Sat, May 26, 2018 at 10:55 AM, Steven D'Aprano wrote: > On Sat, 26 May 2018 08:09:51 +0300, Mikhail V wrote: > >> On Fri, May 25, 2018 at 1:15 PM, bartc wrote: > [...] >>> One problem here is how to deal with embedded non-printable

Re: Re: The PIL show() method looks for the default viewer. How do I change this to a different viewer (of my choice)?

2018-05-26 Thread Paul St George
Thank you. You are very right. The show() method is intended for debugging purposes and is useful for that, but what method should I be using and is PIL the best imaging library for my purposes? I do not want to manipulate images, I only want to show images (full screen) on an external

[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-05-26 Thread Xavier de Gaye
Xavier de Gaye added the comment: I propose to enhance the changes made by PR 6748 and PR 6749 so that gcc 8 triggers a warning when the function type of a PyMethodDef element does not match its flags by using a macro (see below) that casts the function first to the

Re: List replication operator

2018-05-26 Thread Peter Otten
Steven D'Aprano wrote: > On Fri, 25 May 2018 09:28:01 +0200, Peter Otten wrote: > >> Yet another arcanum to learn for beginners with little return. If you >> cannot refrain from tinkering with the language at least concentrate on >> the features with broad application. Thank you. > > Broader

Re: Enums: making a single enum

2018-05-26 Thread Chris Angelico
On Sat, May 26, 2018 at 6:50 PM, Steven D'Aprano wrote: > On Sat, 26 May 2018 18:14:08 +1000, Chris Angelico wrote: > >> On Sat, May 26, 2018 at 6:00 PM, Steven D'Aprano >> wrote: >>> Actually I don't really need all the

Re: why do I get syntax error on if : break

2018-05-26 Thread Grant Edwards
On 2018-05-25, asa32s...@gmail.com wrote: > here is the code, i keep getting an error, "break outside loop". You get the "break outside loop" error because you're using the break statement when you are not inside a loop. > if it is false just exit function You use the

[issue32769] Add 'annotations' to the glossary

2018-05-26 Thread Andrés Delfino
Change by Andrés Delfino : -- pull_requests: +6763 ___ Python tracker ___ ___

[issue33649] asyncio docs overhaul

2018-05-26 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker ___ ___

[issue33624] Implement subclass hooks for asyncio abstract classes

2018-05-26 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker ___ ___

[issue32769] Add 'annotations' to the glossary

2018-05-26 Thread Andrés Delfino
Change by Andrés Delfino : -- pull_requests: +6762 ___ Python tracker ___ ___

[issue33616] typing.NoReturn is undocumented

2018-05-26 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue32769] Add 'annotations' to the glossary

2018-05-26 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: New changeset 6e33f810c9e3a549c9379f24cf1d1752c29195f0 by Ivan Levkivskyi (Andrés Delfino) in branch 'master': bpo-32769: A new take on annotations/type hinting glossary entries (GH-6829)

[issue33653] EnvironmentError does not set errno unless strerror is set

2018-05-26 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: My bad, should have read the doc, sorry. =) -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue33653] EnvironmentError does not set errno unless strerror is set

2018-05-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a documented behavior. If OSError is called with a single argument, it is interpreted as the error message (as in most other exceptions). But if it is called with 2 to 5 arguments, the first argument is interpreted as

Re: Enums: making a single enum

2018-05-26 Thread Peter Otten
Steven D'Aprano wrote: > Am I silly for wanting to make a single enum? > > I have a three-state flag, True, False or Maybe. Is is confusing or bad > practice to make a single enum for the Maybe case? > > > from enum import Enum > class State(Enum): > Maybe = 2 > > Maybe = State.Maybe >

[issue33639] Use high-performance os.sendfile() in shutil.copy*

2018-05-26 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: I updated the code to rely on sendfile(2) on Linux only, which apparently is the only one supporting copy between regular files and added a check to fail immediately in case the filesystem is full. Can somebody review the patch?

[issue33653] EnvironmentError does not set errno unless strerror is set

2018-05-26 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola' : >>> import errno >>> OSError(errno.EBADF).errno >>> OSError(errno.EBADF, "yo").errno 9 >>> IOError(errno.EBADF).errno >>> IOError(errno.EBADF, "yo").errno 9 >>> EnvironmentError(errno.EBADF).errno >>> >>> EnvironmentError(errno.EBADF,

Re: Some Issues on Tagging Text

2018-05-26 Thread subhabangalore
On Saturday, May 26, 2018 at 3:54:37 AM UTC+5:30, Cameron Simpson wrote: > On 25May2018 04:23, Subhabrata Banerjee wrote: > >On Friday, May 25, 2018 at 3:59:57 AM UTC+5:30, Cameron Simpson wrote: > >> On 24May2018 03:13, wrote: > >> >I have a text as, > >> > > >> >"Hawaii volcano generates toxic

Re: Enums: making a single enum

2018-05-26 Thread Marko Rauhamaa
Ian Kelly : > On Fri, May 25, 2018 at 11:00 PM, Chris Angelico wrote: >> # Tri-state logic >> Maybe = object() > > The enum has a nice __str__ though. I use strings for enums: class X: HERE = "HERE" THERE = "THERE" EVERYWHERE =

[issue33647] Add re.replace(string, replacement_map)

2018-05-26 Thread Paal Pedersen
Paal Pedersen added the comment: I forgot to put the ** in the input. This is to further explain what I had in mind: """The meaning of this file is to show how the replace function can be enhanced""" # Today the replace api takes at most 3 arguments, old_string,

Re: Enums: making a single enum

2018-05-26 Thread Serhiy Storchaka
26.05.18 08:07, Ian Kelly пише: On Fri, May 25, 2018 at 11:00 PM, Chris Angelico wrote: On Sat, May 26, 2018 at 2:46 PM, Steven D'Aprano wrote: Am I silly for wanting to make a single enum? I have a three-state flag, True, False or

Re: Computations on pandas dataframes

2018-05-26 Thread Peter Otten
junkaccoun...@outlook.com wrote: > Hi, > > Python newbie here. I need help with the following two tasks I need to > accomplish using Python: > > > > Creating a matrix of rolling variances > > I have a pandas data frame of six columns, I would like to iteratively >

[issue29151] test_asyncore.TestAPI_UseIPv4Select / test_asyncore.TestAPI_UseIPv6Select fails test_handle_close_after_conn_broken

2018-05-26 Thread patrila
patrila added the comment: May I ask what's preventing this issue from being resolved? -- versions: +Python 3.8 ___ Python tracker

[issue29153] Test test.test_asynchat.TestAsynchat / test.test_asynchat.TestAsynchat_WithPoll fail test_close_when_done

2018-05-26 Thread patrila
patrila added the comment: May I ask what's preventing this issue from being resolved? -- versions: +Python 3.8 ___ Python tracker

[issue33644] Fix signatures of tp_finalize handlers in testing code.

2018-05-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue33644] Fix signatures of tp_finalize handlers in testing code.

2018-05-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 9ba3be4718bdf82e20280980807e054004a9bade by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-33644: Fix signatures of tp_finalize handlers in testing code. (GH-7111) (GH-7125)

[issue33622] Fix and improve errors handling in the garbage collector

2018-05-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 7126 adds several assert(!PyErr_Occurred()) for earlier detection of leaked exceptions. And the failure in adding to gc.garbage is no longer fatal. It is better to not add an object to gc.garbage in this iteration than crash

[issue33622] Fix and improve errors handling in the garbage collector

2018-05-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +6761 stage: -> patch review ___ Python tracker ___

Re: Why cannot I use __slots__ and weakrefs together?

2018-05-26 Thread Gregory Ewing
Steven D'Aprano wrote: TypeError: cannot create weak reference to 'Eggs' object Why does weakref hate my Eggs class? Classes with __slots__ aren't automatically given a __weakref__ slot, to save memory I suppose. But you can give it one explicitly: >>> class Eggs: ... __slots__ =

[issue33622] Fix and improve errors handling in the garbage collector

2018-05-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: fixed -> stage: resolved -> status: closed -> open title: Fix errors handling in the garbage collector -> Fix and improve errors handling in the garbage collector ___ Python

Re: Why cannot I use __slots__ and weakrefs together?

2018-05-26 Thread Christian Heimes
On 2018-05-26 11:17, Steven D'Aprano wrote: > Here is my code: > > > > cut here %< > > import weakref > d = weakref.WeakValueDictionary() > > class Spam: > pass > > class Eggs: > __slots__ = ['spanish_inquisition'] > > d['a'] = Spam() # Okay. > d['b'] = Eggs() # Nobody

Why cannot I use __slots__ and weakrefs together?

2018-05-26 Thread Steven D'Aprano
Here is my code: cut here %< import weakref d = weakref.WeakValueDictionary() class Spam: pass class Eggs: __slots__ = ['spanish_inquisition'] d['a'] = Spam() # Okay. d['b'] = Eggs() # Nobody will expect what happens next! cut here %< and the result I get

Re: Enums: making a single enum

2018-05-26 Thread Steven D'Aprano
On Sat, 26 May 2018 18:14:08 +1000, Chris Angelico wrote: > On Sat, May 26, 2018 at 6:00 PM, Steven D'Aprano > wrote: >> Actually I don't really need all the features of Enums, I might just >> define my own class: >> >> >> class Maybe: >> def

  1   2   >