Re: Cult-like behaviour [was Re: Kindness]

2018-07-15 Thread Ed Kellett
On 2018-07-15 15:52, Steven D'Aprano wrote: > On Sun, 15 Jul 2018 14:17:51 +0300, Marko Rauhamaa wrote: > >> Steven D'Aprano : >> >>> On Sun, 15 Jul 2018 11:43:14 +0300, Marko Rauhamaa wrote: Paul Rubin : > I don't think Go is the answer either, but it probably got strings > right.

Re: variable scope in try ... EXCEPT block.

2018-07-13 Thread Ed Kellett
On 2018-07-12 18:00, Chris Angelico wrote: > What do you mean by "fix"? Make the 'x' bind eagerly? That would break > basically every other use of closures. No. I mean make each x a new variable--closures would work as before, for-loops would change. If we have subscopes, it seems natural that

Re: variable scope in try ... EXCEPT block.

2018-07-12 Thread Ed Kellett
On 2018-07-12 14:03, Chris Angelico wrote: > Dealing with reference cycles is generally done *periodically* rather > than immediately (CPython disposes of unreferenced objects immediately > upon last deref). You can avoid having a dedicated cycle detection > pass by using a mark-and-sweep GC, but

Re: variable scope in try ... EXCEPT block.

2018-07-12 Thread Ed Kellett
On 2018-07-12 10:59, Steven D'Aprano wrote: > On Thu, 12 Jul 2018 01:37:24 -0700, aleiphoenix wrote: > >> My question is, does except ... as ... create a new scope from outer >> block, causing 'err' be hidden from outer scope? Is this intentional? > > No, it is not a new scope, and yes, it is

Re: Static variables [was Re: syntax difference]

2018-06-24 Thread Ed Kellett
From: Ed Kellett This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Xw5fa1GFtucLPGBT1sLtLtUpmbraGkiYl Content-Type: multipart/mixed; boundary="lDyl22ZCUIEM3fl5YMnfJ3B8O9bwBCY9r"; protected-headers="v1" From: Ed Kellett To: python-list@python.org Message-ID: <

Re: Static variables [was Re: syntax difference]

2018-06-23 Thread Ed Kellett
On 2018-06-23 06:21, Chris Angelico wrote: > Let's start finding all the edge cases that don't work, so I can work > on fixing them :) Very long functions (or, more specifically, functions with a very large number of consts) will likely prove annoying. signature.asc Description: OpenPGP

Re: syntax difference

2018-06-19 Thread Ed Kellett
On 2018-06-19 11:21, Chris Angelico wrote: > Isn't it nice how comments, being terminated exclusively by > end-of-line, allow the introduction of subtle bugs? Let's see how many > people spot the (presumably deliberate) bug in Steve's code here. Hardly subtle. It does also make them considerably

Re: syntax difference

2018-06-18 Thread Ed Kellett
are you someone's ironic 3rd-year art project signature.asc Description: OpenPGP digital signature -- https://mail.python.org/mailman/listinfo/python-list

Re: syntax difference

2018-06-18 Thread Ed Kellett
On 2018-06-18 13:18, Chris Angelico wrote: > 1) Parse the code, keeping all the non-essential parts as well as the > essential parts. > 2) Find the comments, or find the annotations > 3) If comments, figure out if they're the ones you want to remove. > 4) Reconstruct the file without the bits you

Re: Does inspect.getstack work on other Python implementations?

2018-06-17 Thread Ed Kellett
On 2018-06-17 10:19, Steven D'Aprano wrote: > Anyone here use IronPython, Jython or PyPy? > > Does inspect.getstack always work? Is it considered an implementation > detail for CPython or something promised to work on any compliant > Python interpreter? > > I see that it doesn't even exist on

Re: Splitting up large python module impact on performance?

2018-06-13 Thread Ed Kellett
On 2018-06-13 05:24, Chris Angelico wrote: > Oh wait, your code isn't anything remotely sane. But for the rest of > us, large files aren't a problem. I don't like large files--I think mostly because files are an organisational tool, they're quite good at that job, and one might as well use them.

Re: Why exception from os.path.exists()?

2018-06-09 Thread Ed Kellett
On 2018-06-08 03:42, Chris Angelico wrote: > Apart from the one odd bug with SimpleHTTPServer not properly sending > back 500s, I very much doubt that the original concern - namely that > os.path.exists() and os.stat() raise ValueError if therels a %00 in > the URL - can be abused effectively.

Re: Python web server weirdness

2018-06-07 Thread Ed Kellett
On 2018-06-07 14:32, Steven D'Aprano wrote: > I'm following the instructions here: > > https://docs.python.org/3/library/http.server.html > > > and running this from the command line as a regular unprivileged user: > > python3.5 -m http.server 8000 > > What I expected was a directory listing