Re: cProfile, timed call tree

2018-05-25 Thread dieter
Nico Schlömer writes: > From what I understand about the Python profilers, the type of information > you get from a stats object is > > * How much time was spent in function X, > * what the callers and callees of function X are, and > * and bunch of meta info

Re: Raw string statement (proposal)

2018-05-25 Thread Mikhail V
On Fri, May 25, 2018 at 1:15 PM, bartc wrote: > On 25/05/2018 05:34, Mikhail V wrote: > > I had one big problem with your proposal, which is that I couldn't make head > or tail of your syntax. Such a thing should be immediately obvious. > > (In your first two examples, what IS

Re: Enums: making a single enum

2018-05-25 Thread Chris Angelico
On Sat, May 26, 2018 at 3:07 PM, Ian Kelly wrote: > 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

Re: Enums: making a single enum

2018-05-25 Thread 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 Maybe. Is is confusing or

Re: Enums: making a single enum

2018-05-25 Thread Chris Angelico
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 Maybe. Is is confusing or bad > practice to make a single enum for the Maybe case? > > > from enum import

Enums: making a single enum

2018-05-25 Thread Steven D'Aprano
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 del State Is there a better way of handling a

[issue31096] asyncio.stream.FlowControlMixin._drain_helper may lead to a blocking behavior

2018-05-25 Thread Dmitry Malinovsky
Dmitry Malinovsky added the comment: I've changed the implementation significantly since August 2017, futures are not involved anymore so please ignore that part. However, such drain behavior is still present - but I don't think anymore that yielding to the event loop is

[issue33598] ActiveState Recipes links in docs, and the apparent closure of Recipes

2018-05-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I have seen no official announcement of a shutdown date for > the code.activestate.com website, but it's future has to be > in question considering the migration. We can check with ActiveState but my understanding is that

Re: List replication operator

2018-05-25 Thread Gregory Ewing
bartc wrote: /The/ matrix multiplication operator? In which language? And what was wrong with "*"? It seems you're unaware that Python *already* has an '@' operator. It was added specifically so that numpy could use it for matrix multiplication. A new operator was needed because numpy already

Re: List replication operator

2018-05-25 Thread Gregory Ewing
Dennis Lee Bieber wrote: @ requires use of the weaker/shorter "ring finger" on (for me) the weaker left hand. But... choosing an operator on that basis would be discriminating against left-handed people! -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: List replication operator

2018-05-25 Thread Steven D'Aprano
On Fri, 25 May 2018 09:58:19 -0700, Rob Gaddi wrote: [...] >> This is a frequent, recurring pain point. Experienced programmers >> forget how confusing the behaviour of * is because they're so used to >> the execution model. They forget that writing a list comp is not even >> close to obvious,

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

2018-05-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I would like an example added to the sub(pattern, function, > string) examples. That seems like the most reasonable way to go. -- nosy: +rhettinger ___ Python tracker

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

2018-05-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: How is this needed? SQL queries return rows that are homogenous and with known fields. This is isn't like other dictionaries when you might not know in advance whether a given key is present. -- nosy: +rhettinger

[issue33521] Add 1.32x faster C implementation of asyncio.isfuture().

2018-05-25 Thread Yury Selivanov
Yury Selivanov added the comment: IMO this particular patch is OK and should go in. I'll take another look at the PR in a few days (and will run some benchmarks myself before making the decision). -- ___ Python tracker

[issue33521] Add 1.32x faster C implementation of asyncio.isfuture().

2018-05-25 Thread STINNER Victor
STINNER Victor added the comment: I disagree with your rationale. At least, it is not how we decide to optimize something or not in Python. Python is first made of people who will have to maintain the code for the next 5 years if not longer. C code is harder to maintain

Re: Some Issues on Tagging Text

2018-05-25 Thread MRAB
On 2018-05-25 23:24, Cameron Simpson wrote: [snip] You can reduce that list by generating the "wordlist" form from something smaller: base_phrases = ["Kilauea volcano", "government of Mexico", "Hawaii"] wordlist = [ (base_phrase, " ".join([word + "/TAG" for word in

Re: Some Issues on Tagging Text

2018-05-25 Thread Ben Finney
Cameron Simpson writes: > On 25May2018 04:23, Subhabrata Banerjee wrote: > >On Friday, May 25, 2018 at 3:59:57 AM UTC+5:30, Cameron Simpson wrote: > >> If you want to solve this problem with a programme you must first > >> clearly define what makes an

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

2018-05-25 Thread Dan Stromberg
On Thu, May 24, 2018 at 7:12 PM, wrote: > here is the code, i keep getting an error, "break outside loop". if it is > false just exit function > > > def d(idx): > if type(idx) != int: > break > > d('k') Not what you asked, but I believe pylint recommends using

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

2018-05-25 Thread boB Stepp
On Fri, May 25, 2018 at 6:04 AM, Paul St George wrote: > I am using the Python Imaging Library (PIL), Python 2 and Raspberry Pi 3 B+ > > My code is simply: > > from PIL import Image > > im = Image.open(‘somepic.jpg’) > im.show() # display image > > > But the

Re: List replication operator

2018-05-25 Thread Steven D'Aprano
On Fri, 25 May 2018 13:05:01 -0400, Dennis Lee Bieber wrote: > Let me play devil's advocate... and propose a simple change, with no > new operators... > > sl = [] * n #current behavior > dl = n * [] #deep copy behavior n*[] is already supported. You will suddenly

Re: List replication operator

2018-05-25 Thread Steven D'Aprano
On Sat, 26 May 2018 02:58:06 +1000, Chris Angelico wrote: > Your mail/news client might choose to represent configure.ac as a link, > since ".ac" is a valid TLD. Isn't *everything* a valid TLD now? For the right price, at least. -- Steve --

Re: Some Issues on Tagging Text

2018-05-25 Thread Cameron Simpson
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 gas plume called laze PAHOA: The eruption of Kilauea volcano in

[issue33510] [logging] add JSON log formatter

2018-05-25 Thread Wilfredo Sanchez
Wilfredo Sanchez added the comment: Please consider using RFC 7464 (JSON Text Sequences). This allows detection of truncated JSON events without losing the following event. It allows newlines in the JSON data. All this involves is adding an RS between events.

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

2018-05-25 Thread Wilfredo Sanchez
New submission from Wilfredo Sanchez : The sqlite3.Row class has mapping-like behavior but does not implement the get() method, so providing default values in code requires a bit of boilerplate that is not necessary with dictionaries. -- components: Library

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

2018-05-25 Thread Matthias Bussonnier
Matthias Bussonnier added the comment: > Just to quickly touch on Matthias' question about opt-in or deprecations, a > key thing to note is the ast module is automatically generated from the ASDL > file, so either of those approaches would require developing a

[issue33650] Prohibit adding a signal handler for SIGCHLD

2018-05-25 Thread Yury Selivanov
New submission from Yury Selivanov : Doing that will break subprocesses. -- components: asyncio messages: 317717 nosy: asvetlov, yselivanov priority: normal severity: normal status: open title: Prohibit adding a signal handler for SIGCHLD versions: Python 3.8

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

2018-05-25 Thread Brett Cannon
Brett Cannon added the comment: Just to quickly touch on Matthias' question about opt-in or deprecations, a key thing to note is the ast module is automatically generated from the ASDL file, so either of those approaches would require developing a new mechanism in the code

[issue32841] Asyncio.Condition prevents cancellation

2018-05-25 Thread Bar Harel
Bar Harel added the comment: Yup. Thanks Yuri :-) -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue33598] ActiveState Recipes links in docs, and the apparent closure of Recipes

2018-05-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: The Python Cookbook, based on the site, says that copyright of each recipe is retained by original authors. If so authors who have signed the PSF CLA can contribute their own work. Since Active State must have collectively licensed the

[issue33598] ActiveState Recipes links in docs, and the apparent closure of Recipes

2018-05-25 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I'd suggest to contact ActiveState first before jumping to conclusions. -- nosy: +lemburg ___ Python tracker

[issue33598] ActiveState Recipes links in docs, and the apparent closure of Recipes

2018-05-25 Thread Alex Walters
Alex Walters added the comment: All recipes are MIT licensed unless otherwise noted on the recipe itself. However, AFAICT, all the recipes that are linked to in the docs are written by Raymond Hettinger, so I don't think licensing will be that big of an issue. We

[issue33649] asyncio docs overhaul

2018-05-25 Thread Barry A. Warsaw
Change by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list

[issue33598] ActiveState Recipes links in docs, and the apparent closure of Recipes

2018-05-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: Can you check the copyright and license of the recipe text and code? -- nosy: +terry.reedy ___ Python tracker

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

2018-05-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: Your proposal is underspecified. (And 'yours' is inconsistent with 'your';-). If you want sequential replacememt in multiple scans, make sequential replace calls. Use a loop if the number of replacement scans is variable or large. To be

[issue33649] asyncio docs overhaul

2018-05-25 Thread Yury Selivanov
New submission from Yury Selivanov : An overhaul of asyncio documentation is long overdue. Here's the structure for it that I have in mind: - Introduction (what is asyncio and async/await) - A quick tutorial (show how to use asyncio.run() and basic functions like

[issue30145] Create a How to or Tutorial documentation for asyncio

2018-05-25 Thread Yury Selivanov
Yury Selivanov added the comment: Closing this issue. I'll open a new one for the planned asyncio docs overhaul. -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker

[issue31647] asyncio: StreamWriter write_eof() after close raises mysterious AttributeError

2018-05-25 Thread Yury Selivanov
Yury Selivanov added the comment: If this issue isn't yet fixed could you please submit a PR? -- ___ Python tracker ___

[issue31096] asyncio.stream.FlowControlMixin._drain_helper may lead to a blocking behavior

2018-05-25 Thread Yury Selivanov
Yury Selivanov added the comment: Andrew, what are your thoughts on this one? -- nosy: +asvetlov versions: +Python 3.8 -Python 3.5, Python 3.6 ___ Python tracker

[issue32528] Change base class for futures.CancelledError

2018-05-25 Thread Yury Selivanov
Yury Selivanov added the comment: Closing this issue as I, personally, don't see this happening and there's no point in keeping it open. -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker

[issue30698] asyncio sslproto do not shutdown ssl layer cleanly

2018-05-25 Thread Yury Selivanov
Yury Selivanov added the comment: Is this issue resolved now, or do we need to work on this? -- ___ Python tracker ___

[issue32672] .then execution of actions following a future's completion

2018-05-25 Thread Yury Selivanov
Yury Selivanov added the comment: Closing this one. I don't see us adding Future.then. Feel free to discuss on the MLs. -- components: +asyncio -Library (Lib) nosy: +asvetlov, yselivanov resolution: -> rejected stage: patch review -> resolved

[issue32841] Asyncio.Condition prevents cancellation

2018-05-25 Thread Yury Selivanov
Yury Selivanov added the comment: Should this issue be closed now? -- ___ Python tracker ___

Re: List replication operator

2018-05-25 Thread MRAB
On 2018-05-25 18:05, Dennis Lee Bieber wrote: On Fri, 25 May 2018 15:40:41 + (UTC), Steven D'Aprano declaimed the following: On Fri, 25 May 2018 22:46:37 +1000, Chris Angelico wrote: We've already had a suggestion for [[]]@5 and that should deal

[issue1366311] SRE engine should release the GIL when/if possible

2018-05-25 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: > Did you try to use regex which has this feature? For short strings and simple > patterns there may be no benefit. In my use case, it’s not possible, since the problematic API is glob.iglob() through multiple levels of calls. --

[issue1366311] SRE engine should release the GIL when/if possible

2018-05-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is possible to implement this feature, but it has some limitations. Did you try to use regex which has this feature? For short strings and simple patterns there may be no benefit. -- assignee: -> serhiy.storchaka

[issue33595] Fix references to lambda "arguments"

2018-05-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: Thanks for the fix. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed title: FIx references to lambda "arguments" -> Fix references to lambda "arguments" ___ Python

[issue33595] FIx references to lambda "arguments"

2018-05-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 804fcf66559992db9d23695e501c502ab20b7712 by Terry Jan Reedy in branch '2.7': [2.7] bpo-33595: Fix lambda parameters being refered as arguments (GH-7037) (GH-7122)

[issue33595] FIx references to lambda "arguments"

2018-05-25 Thread Terry J. Reedy
Change by Terry J. Reedy : -- pull_requests: +6757 ___ Python tracker ___ ___

[issue33645] Importing bs4 fails with -3 option in Python 2.7.15

2018-05-25 Thread Florian Schulze
Florian Schulze added the comment: You are right, this actually happens with Python 2.7.14 as well. I was fooled by a warnings.filterwarnings matching to a path in my codebase. That one did match for my Python 2.7.15 testing but didn't for my Python 2.7.14 testing,

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

2018-05-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 7121 is based on PR 5927 and goes one step further. It doesn't introduce a new AST type DocString. Third-party code should not need any adaptation for 3.7. -- ___ Python tracker

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

2018-05-25 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +6756 stage: commit review -> patch review ___ Python tracker

[issue33595] FIx references to lambda "arguments"

2018-05-25 Thread miss-islington
Change by miss-islington : -- pull_requests: +6755 ___ Python tracker ___

[issue33595] FIx references to lambda "arguments"

2018-05-25 Thread miss-islington
Change by miss-islington : -- pull_requests: +6754 stage: backport needed -> patch review ___ Python tracker

[issue33594] add deprecation since 3.5 for a few methods of inspect.

2018-05-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: See also #33582 for 'formatargspec'. -- nosy: +terry.reedy, yselivanov versions: -Python 3.5 ___ Python tracker

[issue33587] inspect.getsource performs unnecessary filesystem stat call

2018-05-25 Thread Terry J. Reedy
Change by Terry J. Reedy : -- stage: -> patch review type: -> performance versions: +Python 3.8 ___ Python tracker ___

[issue33587] inspect.getsource performs unnecessary filesystem stat call

2018-05-25 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +yselivanov title: inspect.getsource performs unnecessary filesystem stat call which is ignored in some circumstances -> inspect.getsource performs unnecessary filesystem stat call ___ Python

[issue33582] formatargspec deprecated but does nto emit DeprecationWarning.

2018-05-25 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +yselivanov versions: -Python 3.5 ___ Python tracker ___

[issue1366311] SRE engine should release the GIL when/if possible

2018-05-25 Thread Armin Rigo
Change by Armin Rigo : -- nosy: -arigo ___ Python tracker ___ ___

[issue33573] statistics.median does not work with ordinal scale, add doc

2018-05-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: I agree. -- assignee: -> docs@python components: +Documentation nosy: +docs@python, terry.reedy resolution: not a bug -> stage: -> needs patch title: statistics.median does not work with ordinal scale -> statistics.median does not

Re: List replication operator

2018-05-25 Thread Rob Gaddi
On 05/25/2018 10:13 AM, bartc wrote: On 25/05/2018 17:58, Rob Gaddi wrote: So, in the spirit of explicit being better than implicit, please assume that for actual implementation replicate would be a static method of actual list, rather than the conveniently executable hackjob below. _list

[issue33521] Add 1.32x faster C implementation of asyncio.isfuture().

2018-05-25 Thread Jimmy Lai
Jimmy Lai added the comment: @vstinner In general, we would like to make all asyncio common functions efficient with C implementation because CPython asyncio overhead is very expensive. In our application, overall it costs about 10% global CPU instructions after we used

[issue1366311] SRE engine should release the GIL when/if possible

2018-05-25 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm reopening this bug even though it's been long closed and even though the attached patch is no longer relevant. We recently found a degenerative performance problem with entrypoints and threads. As the number of threads increases, it

[issue18872] platform.linux_distribution() doesn't recognize Amazon Linux

2018-05-25 Thread Petr Viktorin
Petr Viktorin added the comment: linux_distribution is removed in Python 3.8. -- nosy: +petr.viktorin resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker

[issue19213] platform.linux_distribution detects Oracle Linux as Red Hat Enterprise Linux

2018-05-25 Thread Petr Viktorin
Petr Viktorin added the comment: Er, sorry, I meant in 3.8. -- ___ Python tracker ___

[issue20454] platform.linux_distribution() returns empty value on Archlinux and python 2.7

2018-05-25 Thread Petr Viktorin
Petr Viktorin added the comment: Er, sorry, I meant in 3.8. -- ___ Python tracker ___

[issue19213] platform.linux_distribution detects Oracle Linux as Red Hat Enterprise Linux

2018-05-25 Thread Petr Viktorin
Petr Viktorin added the comment: linux_distribution is removed in Python 3.7. Closing. -- nosy: +petr.viktorin resolution: -> out of date stage: patch review -> resolved status: open -> closed ___ Python tracker

Re: List replication operator

2018-05-25 Thread bartc
On 25/05/2018 17:58, Rob Gaddi wrote: So, in the spirit of explicit being better than implicit, please assume that for actual implementation replicate would be a static method of actual list, rather than the conveniently executable hackjob below. _list = list _nodefault = object() class

[issue20454] platform.linux_distribution() returns empty value on Archlinux and python 2.7

2018-05-25 Thread Petr Viktorin
Petr Viktorin added the comment: linux_distribution is removed in Python 3.7. Closing. -- nosy: +petr.viktorin resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker

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

2018-05-25 Thread INADA Naoki
INADA Naoki added the comment: > B. Revert the feature now for 3.7.0, retargeting for 3.8, and produce a > 3.7.0b5 on a somewhat shorter cycle to allow downstream users to adapt to the > removal. Please note that it can't be reverted simply. The change was introduced

Re: List replication operator

2018-05-25 Thread Rob Gaddi
On 05/25/2018 04:53 AM, 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.

Re: List replication operator

2018-05-25 Thread Chris Angelico
On Sat, May 26, 2018 at 2:43 AM, bartc wrote: > On 25/05/2018 17:11, Alexandre Brault wrote: >> >> >> >> On 2018-05-25 11:40 AM, bartc wrote: >>> >>> On 25/05/2018 16:27, Chris Angelico wrote: You're way WAY too late to debate the matrix multiplication operator. >>> >>>

Re: List replication operator

2018-05-25 Thread Steven D'Aprano
On Fri, 25 May 2018 17:12:12 +0100, bartc wrote: > On 25/05/2018 16:40, Steven D'Aprano wrote: [...] >> On the other hand, it is arguable that what we really need is a >> standard function to return an N-dimensional array/list: >> >> # return a 3x4x5x6 4-D list initialised to all zeroes arr = >>

Re: List replication operator

2018-05-25 Thread bartc
On 25/05/2018 17:11, Alexandre Brault wrote: On 2018-05-25 11:40 AM, bartc wrote: On 25/05/2018 16:27, Chris Angelico wrote: You're way WAY too late to debate the matrix multiplication operator. /The/ matrix multiplication operator? In which language? And what was wrong with "*"? In

Re: List replication operator

2018-05-25 Thread Steven D'Aprano
On Fri, 25 May 2018 11:59:38 -0400, Dennis Lee Bieber wrote: > What is your definition of a multi-dimensional array -- I tend to think > of them as pre-declared sizes; not the variable (row|column) lengths > possible when using nested lists. Any fixed size array can be implemented using

Re: "Data blocks" syntax specification draft

2018-05-25 Thread Steven D'Aprano
On Tue, 22 May 2018 08:01:05 +0200, Christian Gollwitzer wrote: >>> If a block of static data is large enough to start to be ugly, a >>> common approach is to load the data from some other file, in a >>> language which is designed around structured data. [...] > Thing is, you can do it already

Re: List replication operator

2018-05-25 Thread Alexandre Brault
On 2018-05-25 11:40 AM, bartc wrote: > On 25/05/2018 16:27, Chris Angelico wrote: >> You're way WAY too late to debate the matrix multiplication operator. > > /The/ matrix multiplication operator? > > In which language? And what was wrong with "*"? > In Python, the language we're discussing

Re: List replication operator

2018-05-25 Thread bartc
On 25/05/2018 16:40, Steven D'Aprano wrote: On Fri, 25 May 2018 22:46:37 +1000, Chris Angelico wrote: We've already had a suggestion for [[]]@5 and that should deal with that issue. Steven is proposing "multiply by copying" as an alternative to "multiply by referencing", so an alternative

[issue33647] Make string.replace accept a dict instead of two arguments

2018-05-25 Thread R. David Murray
Change by R. David Murray : -- versions: -Python 3.6, Python 3.7 ___ Python tracker ___

[issue33647] Make string.replace accept a dict instead of two arguments

2018-05-25 Thread R. David Murray
R. David Murray added the comment: That is not kwargs, that's a passing a dict. Which is what you would want, since the strings you want to replace might not be valid identifiers, and so couldn't be passed as keyword arguments. I think I'm -0.5 on this. I don't think

Re: List replication operator

2018-05-25 Thread Chris Angelico
On Sat, May 26, 2018 at 1:40 AM, bartc wrote: > On 25/05/2018 16:27, Chris Angelico wrote: >> >> On Fri, May 25, 2018 at 10:58 PM, bartc wrote: >>> >>> I'm in general not in favour of piling in special symbols into a language >>> just to solve some obscure or

Re: List replication operator

2018-05-25 Thread Chris Angelico
On Sat, May 26, 2018 at 1:46 AM, Steven D'Aprano wrote: > On Fri, 25 May 2018 18:06:00 +1000, Chris Angelico wrote: > >> Downside: while it's all very well to say that this is equivalent to >> copy.deepcopy(), that would imply replicating copy.deepcopy's

Undocumented unescape() method in HTMLParser?

2018-05-25 Thread Tobiah
I came across its usage in StackOverflow somewhere, but didn't see it in the docs. I'm using 2.7. I needed it while writing a class for generating text documents out of HTML documents for attaching to emails, which lowers spam scores. I lifted the basis for this from the top answer here:

Re: List replication operator

2018-05-25 Thread Steven D'Aprano
On Fri, 25 May 2018 18:06:00 +1000, Chris Angelico wrote: > Downside: while it's all very well to say that this is equivalent to > copy.deepcopy(), that would imply replicating copy.deepcopy's semantics > in the core list type (unless it's actually literally defined as > importing a module and

Re: List replication operator

2018-05-25 Thread Steven D'Aprano
On Fri, 25 May 2018 18:06:00 +1000, Chris Angelico wrote: > Downside: while it's all very well to say that this is equivalent to > copy.deepcopy(), that would imply replicating copy.deepcopy's semantics > in the core list type (unless it's actually literally defined as > importing a module and

[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2018-05-25 Thread STINNER Victor
STINNER Victor added the comment: """ This particular kind of bad traverse is quite easy to write if an extension author doesn't read docs carefully, or has read an old version of them (before the fix here). And resulting errors aren't too obvious. So, there's code to

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

2018-05-25 Thread Matthias Bussonnier
Matthias Bussonnier added the comment: Łukasz Langa wrote: > Inadasan, I think what we should do is to amend `ast.parse()` and `compile()` > docs that mode="exec" treats given code as a module, we should even give the > docstring handling as an example. That is

Re: List replication operator

2018-05-25 Thread bartc
On 25/05/2018 16:27, Chris Angelico wrote: On Fri, May 25, 2018 at 10:58 PM, bartc wrote: I'm in general not in favour of piling in special symbols into a language just to solve some obscure or rare problem. As I went on to demonstrate, function-like syntax (or even actual

Re: List replication operator

2018-05-25 Thread Steven D'Aprano
On Fri, 25 May 2018 22:46:37 +1000, Chris Angelico wrote: > We've already had a suggestion for [[]]@5 and that should deal with that > issue. Steven is proposing "multiply by copying" as an alternative to > "multiply by referencing", so an alternative multiplication operator > should fit that

[issue33648] unused with_c_locale_warning option in configure should be removed

2018-05-25 Thread Eitan Adler
Eitan Adler added the comment: yeah, I was looking at that too. I think someone else modified related files but never ran a regen (or did so with different tooling than I). Even on master, my regen results in changes. -- ___

[issue33645] Importing bs4 fails with -3 option in Python 2.7.15

2018-05-25 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +6753 stage: -> patch review ___ Python tracker ___

[issue33645] Importing bs4 fails with -3 option in Python 2.7.15

2018-05-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ah, I was fooled by the message about Beautiful Soup. It is not a message of an error, it is a part of source line, printed for a SyntaxError. Seems sources of Beautiful Soup intentionally contain a code invalid in Python 3.

Re: List replication operator

2018-05-25 Thread Steven D'Aprano
On Fri, 25 May 2018 13:58:03 +0100, bartc wrote: > As for '@', if a variable name can come before it /and/ after it, and > either or both can be dotted, wouldn't that cause it to be highlighted > as an email address in many circumstances? Such as in code posted here. Sure. And x/y might be

Re: List replication operator

2018-05-25 Thread Chris Angelico
On Fri, May 25, 2018 at 10:58 PM, bartc wrote: > I'm in general not in favour of piling in special symbols into a language > just to solve some obscure or rare problem. > > As I went on to demonstrate, function-like syntax (or even actual functions) > could do that job better, by

[issue33648] unused with_c_locale_warning option in configure should be removed

2018-05-25 Thread Nick Coghlan
Nick Coghlan added the comment: Huh, I thought I cleaned those out when I made the compilation unconditional. I guess not :) The actual fix looks good to me, but the autoconf regeneration looks unexpectedly noisy, so I've asked Benjamin Peterson to take a look at it.

[issue26826] Expose new copy_file_range() syscall in os module.

2018-05-25 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Check for availability in configure.ac appears to be broken. -- ___ Python tracker ___

[issue33645] Importing bs4 fails with -3 option in Python 2.7.15

2018-05-25 Thread Florian Schulze
Florian Schulze added the comment: Yes, it's third party code, but that worked up until Python 2.7.14 and only broke with 2.7.15, which is why I reported it here. The expected behaviour is not a SyntaxError, but a DeprecationWarning, which is what you get pre Python

[issue33648] unused with_c_locale_warning option in configure should be removed

2018-05-25 Thread Eitan Adler
Change by Eitan Adler : -- keywords: +patch pull_requests: +6752 stage: -> patch review ___ Python tracker ___

[issue33648] unused with_c_locale_warning option in configure should be removed

2018-05-25 Thread STINNER Victor
STINNER Victor added the comment: It's related to the PEP 538. Note: see also the PEP 540 (not directly related). -- nosy: +ncoghlan, vstinner ___ Python tracker

[issue33622] Fix errors handling in the garbage collector

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

[issue33648] unused with_c_locale_warning option in configure should be removed

2018-05-25 Thread Eitan Adler
New submission from Eitan Adler : There is an option for --with-c-locale-warning which was turned into a run-time option in eb81795d7d3a8c898fa89a376d63fc3bbfb9a081. The configuration should be cleaned up. -- messages: 317676 nosy: eitan.adler priority: normal

  1   2   >