Re: syntax difference

2018-06-25 Thread Bart
To: Chris Angelico From: Bart On 24/06/2018 15:46, Chris Angelico wrote: > On Sun, Jun 24, 2018 at 8:40 PM, Steven D'Aprano > wrote: >> On Sun, 24 Jun 2018 11:18:37 +0100, Bart wrote: >> >>> I wonder why it is just me that constantly needs to justify his >>> existence in this group? >> >>

Re: syntax difference

2018-06-25 Thread Chris Angelico
From: Chris Angelico On Sun, Jun 24, 2018 at 8:40 PM, Steven D'Aprano wrote: > On Sun, 24 Jun 2018 11:18:37 +0100, Bart wrote: > >> I wonder why it is just me that constantly needs to justify his >> existence in this group? > > Because its just you who spends 90% of his time here complaining

Introducing Coconut

2018-06-25 Thread Steven D'Aprano
From: Steven D'Aprano Coconut, the functional programming language which compiles to Python: http://coconut.readthedocs.io/en/master/FAQ.html http://coconut-lang.org/ (Its not my language. I just think its cool.) -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been

Package directory question

2018-06-25 Thread Robert Latest
From: Robert Latest Hello, I'm building an application which consists of two largely distinct parts, a frontend and a backend. The directory layout is like this: |-- jobwatch | |-- backend | | |-- backend.py | | |-- __init__.py | | `-- tables.py | |-- frontend | | |--

Python for beginners or not? [was Re: syntax difference]

2018-06-25 Thread Steven D'Aprano
From: Steven D'Aprano On Sat, 23 Jun 2018 14:52:24 -0500, boB Stepp wrote: [...] >> There is a place for various levels of programming language. I'm saying >> that Python which is always touted as a 'simple' language suitable for >> beginners, is missing a surprising number of basics. > > I

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-25 Thread Stefan Ram
To: Steven D'Aprano From: r...@zedat.fu-berlin.de (Stefan Ram) Steven D'Aprano writes: >It has been a long, long time since Python has been a "simple" language >suitable for rank beginners, if it ever was. Python is not Scratch. Python is simpler insofar as you can write on a higher level

Re: Static variables [was Re: syntax difference]

2018-06-25 Thread Bart
To: Ben Bacarisse From: Bart On 24/06/2018 01:53, Ben Bacarisse wrote: > Bart writes: >> Wow. (Just think of all the times you write a function containing a >> neat bunch of local functions, every time it's called it has to create >> a new function instances for each of those functions, even

Re: Static variables [was Re: syntax difference]

2018-06-25 Thread Steven D'Aprano
From: Steven D'Aprano On Sun, 24 Jun 2018 11:23:12 +0100, Bart wrote: > On 24/06/2018 01:53, Ben Bacarisse wrote: >> Bart writes: > >>> Wow. (Just think of all the times you write a function containing a >>> neat bunch of local functions, every time it's called it has to create >>> a new

Re: Quick survey: locals in comprehensions (Python 3 only)

2018-06-25 Thread Jim Lee
From: Jim Lee On 06/23/2018 11:02 PM, Chris Angelico wrote: > On Sun, Jun 24, 2018 at 3:44 PM, Jim Lee wrote: >> >> On 06/23/2018 10:03 PM, Steven D'Aprano wrote: >>> I'd like to run a quick survey. There is no right or wrong answer, since >>> this is about your EXPECTATIONS, not what Python

Re: syntax difference

2018-06-25 Thread Steven D'Aprano
From: Steven D'Aprano On Sun, 24 Jun 2018 11:18:37 +0100, Bart wrote: > I wonder why it is just me that constantly needs to justify his > existence in this group? Because its just you who spends 90% of his time here complaining about how Python does it wrong. -- Steven D'Aprano "Ever since I

Re: Quick survey: locals in comprehensions (Python 3 only)

2018-06-25 Thread Jim Lee
From: Jim Lee On 06/23/2018 10:03 PM, Steven D'Aprano wrote: > I'd like to run a quick survey. There is no right or wrong answer, since > this is about your EXPECTATIONS, not what Python actually does. > > Given this function: > > > def test(): > a = 1 > b = 2 > result = [value

Re: nltk related issue

2018-06-25 Thread Glenn Hutchings
To: Sharan Basappa From: Glenn Hutchings On 21/06/18 04:40, Sharan Basappa wrote: > Folks, > > I am trying to run a simple example associated with nltk. > I get some error and I don't know what the issue is. > I need some guidance please. > [...] > LookupError: >

Re: Quick survey: locals in comprehensions (Python 3 only)

2018-06-25 Thread Steven D'Aprano
From: Steven D'Aprano On Sun, 24 Jun 2018 15:18:49 +1000, Chris Angelico wrote: > Personally, I think it should give you [1, 2], the two values from the > function's locals. Thank you, that's the sort of answer I'm looking for. (I'm not saying I didn't read your long and involved analysis,

Re: syntax difference

2018-06-25 Thread Bart
To: boB Stepp From: Bart On 24/06/2018 00:44, boB Stepp wrote: > On Sat, Jun 23, 2018 at 5:35 PM Bart wrote: >> I'm not a user... > > Then I am truly puzzled, Bart. Why do you even bother to hang out on > this list? If you do not want to use Python and you do not want to > improve Python's

Re: Quick survey: locals in comprehensions (Python 3 only)

2018-06-25 Thread Chris Angelico
From: Chris Angelico On Sun, Jun 24, 2018 at 3:03 PM, Steven D'Aprano wrote: > I'd like to run a quick survey. There is no right or wrong answer, since > this is about your EXPECTATIONS, not what Python actually does. > > Given this function: > > > def test(): > a = 1 > b = 2 >

Re: Quick survey: locals in comprehensions (Python 3 only)

2018-06-25 Thread Jim Lee
From: Jim Lee On 06/23/2018 11:16 PM, Chris Angelico wrote: > On Sun, Jun 24, 2018 at 4:08 PM, Jim Lee wrote: >> There are three locals: a, b, and result. Since result cannot be assigned >> a value until the list comp has been evaluated, I would expect the comp to >> return a value of

Re: Quick survey: locals in comprehensions (Python 3 only)

2018-06-25 Thread Chris Angelico
From: Chris Angelico On Sun, Jun 24, 2018 at 4:08 PM, Jim Lee wrote: > There are three locals: a, b, and result. Since result cannot be assigned > a value until the list comp has been evaluated, I would expect the comp to > return a value of "None" for result. An argument could also be made

Re: translating foreign data

2018-06-25 Thread Chris Angelico
From: Chris Angelico On Sun, Jun 24, 2018 at 1:23 PM, Steven D'Aprano wrote: > On Sun, 24 Jun 2018 12:53:49 +1000, Chris Angelico wrote: > > [...] >>> Okay, you want a bit-pattern. In hex: >>> >>> '0x313030e282ac' > [...] > >> Hmm. Actually, I'm a bit confused. >> > hex("100ΓΘ¼".encode())

Re: translating foreign data

2018-06-25 Thread Steven D'Aprano
From: Steven D'Aprano On Sun, 24 Jun 2018 12:53:49 +1000, Chris Angelico wrote: [...] >> Okay, you want a bit-pattern. In hex: >> >> '0x313030e282ac' [...] > Hmm. Actually, I'm a bit confused. > hex("100ΓΘ¼".encode()) > Traceback (most recent call last): > File "", line 1, in >

Re: Quick survey: locals in comprehensions (Python 3 only)

2018-06-25 Thread Chris Angelico
From: Chris Angelico On Sun, Jun 24, 2018 at 3:44 PM, Jim Lee wrote: > > > On 06/23/2018 10:03 PM, Steven D'Aprano wrote: >> >> I'd like to run a quick survey. There is no right or wrong answer, since >> this is about your EXPECTATIONS, not what Python actually does. >> >> Given this function:

Re: translating foreign data

2018-06-25 Thread Chris Angelico
From: Chris Angelico On Sun, Jun 24, 2018 at 12:44 PM, Steven D'Aprano wrote: > You're joking, right? You can't possibly be so ignorant as to actually > believe that. You have, right in front of you, a news post or email > containing the text string "100ΓΘ¼", and yet you are writing apparently

Quick survey: locals in comprehensions (Python 3 only)

2018-06-25 Thread Steven D'Aprano
From: Steven D'Aprano I'd like to run a quick survey. There is no right or wrong answer, since this is about your EXPECTATIONS, not what Python actually does. Given this function: def test(): a = 1 b = 2 result = [value for key, value in locals().items()] return result

Re: translating foreign data

2018-06-25 Thread Steven D'Aprano
From: Steven D'Aprano On Sat, 23 Jun 2018 17:52:55 -0400, Richard Damon wrote: > If you have more than just a number representing a value in the locale > currency, you can't ask the locale how to present/accept it. You're the only one saying that it has to be handled by the locale. -- Steven

Re: Static variables [was Re: syntax difference]

2018-06-25 Thread Steven D'Aprano
From: Steven D'Aprano On Sat, 23 Jun 2018 18:29:51 +0100, MRAB wrote: > You can already do something similar like this: > > def f(): > f.x += 1 > return f.x > f.x = 0 > > [snip] You can, but only as an illustration, not as a serious implementation. The whole point of static local

Re: translating foreign data

2018-06-25 Thread Steven D'Aprano
From: Steven D'Aprano On Sat, 23 Jun 2018 17:05:17 -0400, Richard Damon wrote: > On 6/23/18 11:27 AM, Steven D'Aprano wrote: >> On Sat, 23 Jun 2018 09:42:29 -0400, Richard Damon wrote: >> >>> On 6/23/18 9:05 AM, Marko Rauhamaa wrote: Ok. Here's a value for you: 100ΓΘ¼ [...]

Re: Static variables [was Re: syntax difference]

2018-06-25 Thread Steven D'Aprano
From: Steven D'Aprano On Sat, 23 Jun 2018 21:44:00 +0100, Bart wrote: > Since these references are created via the return g statement here: > > def f(): > def g(): > > return g > > (say to create function references i and j like this: > > i = f() >

Re: Static variables [was Re: syntax difference]

2018-06-25 Thread Steven D'Aprano
From: Steven D'Aprano On Sun, 24 Jun 2018 00:37:36 +0100, Bart wrote: > Do you mean that if the same 'def' block is re-executed, it will create > a different instance of the function? (Same byte-code, but a different > set of everything else the function uses.) That's not as slow as you think

Re: Static variables [was Re: syntax difference]

2018-06-25 Thread Gregory Ewing
To: Bart From: Gregory Ewing Bart wrote: > Wow. (Just think of all the times you write a function containing a neat > bunch of local functions, every time it's called it has to create a new > function instances for each of those functions, even if they are not used.) Fortunately, function

Re: syntax difference

2018-06-25 Thread boB Stepp
From: boB Stepp On Sat, Jun 23, 2018 at 5:35 PM Bart wrote: > > On 23/06/2018 20:52, boB Stepp wrote: > The first programming exercise I ever did involved asking for three > numbers, then determining whether those numbers could form the sides of > a triangle. > > Then [40 years ago], the easy

Re: syntax difference

2018-06-25 Thread Steven D'Aprano
From: Steven D'Aprano On Sat, 23 Jun 2018 23:26:43 +0100, Bart wrote: > Then [40 years ago], the easy part was reading the three numbers. Now > that would be the more challenging part. # Get three numbers, separated by spaces, with no error-recovery. # If you try to read bad data, the process

Re: syntax difference

2018-06-25 Thread Gregory Ewing
To: Bart From: Gregory Ewing Bart wrote: > But 40 years > ago it was just 'readln a,b,c'; it was just taken for granted. The problem with something like that is that it's really only useful for throwaway code. For any serious application, you need to deal with the possibility of malformed

Re: Static variables [was Re: syntax difference]

2018-06-25 Thread Chris Angelico
From: Chris Angelico On Sun, Jun 24, 2018 at 9:37 AM, Bart wrote: > On 23/06/2018 23:25, Ben Bacarisse wrote: >> >> Bart writes: >> >>> On 23/06/2018 21:13, Chris Angelico wrote: On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote: >>> >>> > (At what point would that happen anyway; if

Re: syntax difference

2018-06-25 Thread Bart
To: boB Stepp From: Bart On 23/06/2018 20:52, boB Stepp wrote: > I've finally found time to examine this rather long, rambling thread. >> There is a place for various levels of programming language. I'm saying that Python which is always touted as a 'simple' language suitable for beginners,

Re: Static variables [was Re: syntax difference]

2018-06-25 Thread Ben Bacarisse
To: Bart From: Ben Bacarisse Bart writes: > On 23/06/2018 23:25, Ben Bacarisse wrote: >> Bart writes: >> >>> On 23/06/2018 21:13, Chris Angelico wrote: On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote: >>> > (At what point would that happen anyway; if you do this: >>> NONE of

Re: Static variables [was Re: syntax difference]

2018-06-25 Thread Ben Bacarisse
To: Bart From: Ben Bacarisse Bart writes: > On 23/06/2018 21:13, Chris Angelico wrote: >> On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote: > >>> (At what point would that happen anyway; if you do this: > >> NONE of your examples are taking copies of the function. They all are >> making

Re: Static variables [was Re: syntax difference]

2018-06-25 Thread Bart
To: Ben Bacarisse From: Bart On 23/06/2018 23:25, Ben Bacarisse wrote: > Bart writes: > >> On 23/06/2018 21:13, Chris Angelico wrote: >>> On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote: >> (At what point would that happen anyway; if you do this: >> >>> NONE of your examples are taking

Re: translating foreign data

2018-06-25 Thread Richard Damon
From: Richard Damon On 6/23/18 5:31 PM, Ben Finney wrote: > Richard Damon writes: > >> On 6/23/18 11:27 AM, Steven D'Aprano wrote: On 6/23/18 9:05 AM, Marko Rauhamaa wrote: > Richard Damon wrote: >> Data presented to the user should normally use his locale >> (unless he has

Re: translating foreign data

2018-06-25 Thread Ben Finney
From: Ben Finney Richard Damon writes: > On 6/23/18 11:27 AM, Steven D'Aprano wrote: > >> On 6/23/18 9:05 AM, Marko Rauhamaa wrote: > >>> Richard Damon wrote: > >>> > Data presented to the user should normally use his locale > >>> > (unless he has specified something different). > >>> > >>>

Re: translating foreign data

2018-06-25 Thread Richard Damon
From: Richard Damon On 6/23/18 11:27 AM, Steven D'Aprano wrote: > On Sat, 23 Jun 2018 09:42:29 -0400, Richard Damon wrote: > >> On 6/23/18 9:05 AM, Marko Rauhamaa wrote: >>> Ok. Here's a value for you: >>> >>> 100ΓΘ¼ >>> >>> I see '1', '0', '0', 'ΓΘ¼'. What do you see in your locale

Re: syntax difference

2018-06-25 Thread boB Stepp
From: boB Stepp I've finally found time to examine this rather long, rambling thread. On Wed, Jun 20, 2018 at 5:46 AM wrote: > > Yeah, people keep bringing that up when they run out of arguments. > > So, every programmer must always use the most advanced, most esoteric features possible at

Re: Static variables [was Re: syntax difference]

2018-06-25 Thread Bart
To: Chris Angelico From: Bart On 23/06/2018 21:13, Chris Angelico wrote: > On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote: >> (At what point would that happen anyway; if you do this: > NONE of your examples are taking copies of the function. They all are > making REFERENCES to the same

Re: Static variables [was Re: syntax difference]

2018-06-25 Thread Chris Angelico
From: Chris Angelico On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote: > This is an example of a simple concept getting so out of hand that it will > either never be implemented, or the resulting implementation becomes > impractical to use. > > This is what we're trying to do: > > def nextx():

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Inada-san! Seems this issue can be closed as a third party issue. -- ___ Python tracker ___

[issue33278] libexpat uses HAVE_SYSCALL_GETRANDOM instead of HAVE_GETRANDOM_SYSCALL

2018-06-25 Thread Benjamin Peterson
Benjamin Peterson added the comment: Python calls XML_SetHashSalt, so expat itself doesn't need to generate randomness. -- nosy: +benjamin.peterson resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-25 Thread INADA Naoki
INADA Naoki added the comment: I found original pull request and issue report https://github.com/conda/conda/pull/4558 https://github.com/ContinuumIO/anaconda-issues/issues/1410 -- ___ Python tracker

[issue33956] update vendored expat to 2.2.5

2018-06-25 Thread Benjamin Peterson
New submission from Benjamin Peterson : https://github.com/libexpat/libexpat/releases/tag/R_2_2_5 Release 2.2.5 Tue October 31 2017 Bug fixes: #8 If the parser runs out of memory, make sure its internal state reflects the memory it actually has, not

Re: moving to Python from Java/C++/C

2018-06-25 Thread Dan Stromberg
On Mon, Jun 25, 2018 at 3:40 AM, wrote: > Hey, > I already have quite an experience in programming, and I wish to study > Python as well. I need to study it before I continue with my comp. science > academic studies. > How do you recommend studying it? As mentioned in the headline, I already >

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-25 Thread Mark Lawrence
On 25/06/18 17:15, jkn wrote: On Monday, June 25, 2018 at 4:23:57 PM UTC+1, Chris Angelico wrote: On Mon, Jun 25, 2018 at 11:15 PM, jkn wrote: (as well as pedanticism ;-o). Pedantry. ChrisA (You know I can't let that one pass.) I was chanel[l]ing the TimBot, as any fule kno... Ritten

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-25 Thread jkn
On Monday, June 25, 2018 at 4:23:57 PM UTC+1, Chris Angelico wrote: > On Mon, Jun 25, 2018 at 11:15 PM, jkn wrote: > > (as well as pedanticism ;-o). > > Pedantry. > > ChrisA > (You know I can't let that one pass.) I was chanel[l]ing the TimBot, as any fule kno... --

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-25 Thread INADA Naoki
INADA Naoki added the comment: I grepped PYTHONIOENCODING and found this line. https://github.com/conda/conda/blob/082fe8fd7458ecd9dd7547749039f4b1f06d76db/conda/activate.py#L726 -- ___ Python tracker

Proper way to download stylesheets and templates

2018-06-25 Thread T Berger
I’m creating a webapp and trying to download a stylesheet and templates from my manual’s support site. I must be doing something wrong, because when I try to run my app, I get a 404 error message. I downloaded the files by dragging them off the screen into my webapp folder. But I’m getting a

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-25 Thread INADA Naoki
INADA Naoki added the comment: When I grepped "Unknown encoding 874", I see some people got trouble from anaconda installation. I don't know about what anaconda setup does, but it will not happen on normal CPython. We use UTF-8 by default on Windows, for fsencoding and console encoding,

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-25 Thread INADA Naoki
Change by INADA Naoki : -- nosy: +inada.naoki ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-25 Thread Alister via Python-list
On Mon, 25 Jun 2018 11:42:27 +0100, Mark Lawrence wrote: > On 25/06/18 10:10, Alister via Python-list wrote: >> On Mon, 25 Jun 2018 11:36:25 +0400, Abdur-Rahmaan Janhangeer wrote: >> >>> i think he means like for a loop to iterate over a list you might do >>> >>> list = [1,2,3] >>> for i in

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-25 Thread Chris Angelico
On Mon, Jun 25, 2018 at 11:15 PM, jkn wrote: > (as well as pedanticism ;-o). Pedantry. ChrisA (You know I can't let that one pass.) -- https://mail.python.org/mailman/listinfo/python-list

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-25 Thread Grant Edwards
On 2018-06-25, Steven D'Aprano wrote: > And the specific line you reference is *especially* a joke, one which > flies past nearly everyone's head: > > There should be one-- and preferably only one --obvious way to do it. > > Notice the dashes? There are *two* traditional ways to use an pair >

Re: Quick survey: locals in comprehensions (Python 3 only)

2018-06-25 Thread Tim Chase
On 2018-06-23 23:08, Jim Lee wrote: >>> On 06/23/2018 10:03 PM, Steven D'Aprano wrote: def test(): a = 1 b = 2 result = [value for key, value in locals().items()] return result what would you expect the result of calling test() to be?

Re: Quick survey: locals in comprehensions (Python 3 only)

2018-06-25 Thread Tim Chase
On 2018-06-24 05:03, Steven D'Aprano wrote: > I'd like to run a quick survey. There is no right or wrong answer, > since this is about your EXPECTATIONS, not what Python actually > does. > > Given this function: > > def test(): > a = 1 > b = 2 > result = [value for key, value in

Accessing the Python list

2018-06-25 Thread Paul St George
Understanding and having an interest in Python does not imply knowledge of Usenet, mailing lists, NNTP, gateways, gmane, bottom-posting, vanilla-flopping, /et al/. But, knowledge of these seems to be needed (or is at least useful) in order to fully benefit from the Python list. Would it be

[issue32568] Fix handling of sizehint=-1 in select.epoll()

2018-06-25 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24567] random.choice IndexError due to double-rounding

2018-06-25 Thread Mark Dickinson
Mark Dickinson added the comment: > Python _configuration_ should be changed to disable double rounding on such > platforms That sounds good to me, with the nitpick that setting an x87 FPU to 53-bit precision still doesn't avoid potential double rounding on underflow, and I'm not aware of

[issue33774] Document that @lru_cache caches based on exactly how the function arguments are specified

2018-06-25 Thread Al-Scandar Solstag
Al-Scandar Solstag added the comment: Speaking frankly, I might not have grasped what might happen by reading your line. I think having at least a minimal example is crucial. Perhaps: "Distinct argument patterns, such as `f(1)` and `f(first_arg=1)`, may not cache for each other even if the

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-25 Thread jkn
On Monday, June 25, 2018 at 12:17:29 PM UTC+1, Paul Moore wrote: > On 25 June 2018 at 11:53, Steven D'Aprano > wrote: > > > And the specific line you reference is *especially* a joke, one which > > flies past nearly everyone's head: > > > > There should be one-- and preferably only one

Re: moving to Python from Java/C++/C

2018-06-25 Thread edmondo . giovannozzi
Il giorno lunedì 25 giugno 2018 12:40:53 UTC+2, itai...@gmail.com ha scritto: > Hey, > I already have quite an experience in programming, and I wish to study Python > as well. I need to study it before I continue with my comp. science academic > studies. > How do you recommend studying it? As

moving to Python from Java/C++/C

2018-06-25 Thread itaiyz97
Hey, I already have quite an experience in programming, and I wish to study Python as well. I need to study it before I continue with my comp. science academic studies. How do you recommend studying it? As mentioned in the headline, I already know Java, C++ and C. Thanks! --

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-25 Thread Mark Lawrence
On 25/06/18 10:10, Alister via Python-list wrote: On Mon, 25 Jun 2018 11:36:25 +0400, Abdur-Rahmaan Janhangeer wrote: i think he means like for a loop to iterate over a list you might do list = [1,2,3] for i in range(len(list)): print(list[i]) but the you might as well go for the

[ANN] pdfposter 0.7

2018-06-25 Thread Hartmut Goebel
I'm pleased to announce pdftools.pdfposter 0.7, a tool to scale and tile PDF images/pages to print on multiple pages. :Homepage: https://pdfposter.readthedocs.io/ :Author:   Hartmut Goebel :Licence:  GNU Public Licence v3 (GPLv3) :Quick Installation:     pip install -U pdftools.pdfposter

[issue33930] Segfault with deep recursion into object().__dir__

2018-06-25 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33914] test_gdb fails for Python 2.7.15

2018-06-25 Thread Vibhuti
Vibhuti added the comment: STINNER Hi I tried the commit but it did not work.The same failure is observed. -- ___ Python tracker ___

[issue33851] 3.7 regression: ast.get_docstring() for a node that lacks a docstring

2018-06-25 Thread Marius Gedminas
Marius Gedminas added the comment: I've ran my findimports testsuite with CPython's git commit a50b825c18a92655f3dd7939e793fa3d4440d886 and my tests passed, so yes. -- ___ Python tracker

[issue33914] test_gdb fails for Python 2.7.15

2018-06-25 Thread Vibhuti
Vibhuti added the comment: Hi ,sorry for the delayed reply The architecture is s390x and the OS is SLES 12 SP3 (however test_gdb fails on SLES 11 SP4 too) Python was installed using https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tar.xz The whole output of `./python -Werror -m test -v

[issue33930] Segfault with deep recursion into object().__dir__

2018-06-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The trashcan mechanism is used for slot wrappers. The following code doesn't crash: o = object() for x in range(100): o = o.__hash__ -- ___ Python tracker

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

2018-06-25 Thread Tal Einat
Change by Tal Einat : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

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

2018-06-25 Thread Tal Einat
Tal Einat added the comment: New changeset 8fd8cfa369fe4b6d6ac430cd28ead32717df7bee by Tal Einat (Miss Islington (bot)) in branch '3.6': [3.6] bpo-33573: docs to suggest median() alternatives for non-numeric data (GH-7587) (GH-7907)

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

2018-06-25 Thread Tal Einat
Tal Einat added the comment: New changeset 150cd3cb272021e9a2d865dd28486b00199fe77d by Tal Einat (Miss Islington (bot)) in branch '3.7': [3.7] bpo-33573: docs to suggest median() alternatives for non-numeric data (GH-7587) (GH-7906)

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-25 Thread Paul Moore
On 25 June 2018 at 11:53, Steven D'Aprano wrote: > And the specific line you reference is *especially* a joke, one which > flies past nearly everyone's head: > > There should be one-- and preferably only one --obvious way to do it. > > > Notice the dashes? There are *two* traditional ways to use

[issue33955] Implement PyOS_CheckStack on macOS using pthread_get_stack*_np

2018-06-25 Thread Ronald Oussoren
New submission from Ronald Oussoren : The (non-portable) pthread APIs "pthread_get_stacksize_np()" and "pthread_get_stackaddr_np()" can be used to implement PyOS_CheckStack on macOS, which would give nicer behavior than crashing when the recursion limit is too high for the stack size of the

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

2018-06-25 Thread miss-islington
Change by miss-islington : -- pull_requests: +7513 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2018-06-25 Thread miss-islington
Change by miss-islington : -- pull_requests: +7512 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2018-06-25 Thread Tal Einat
Tal Einat added the comment: New changeset fdd6e0bf18517c3dc5e24c48fbfe890229fad1b5 by Tal Einat in branch 'master': bpo-33573: docs to suggest median() alternatives for non-numeric data (GH-7587) https://github.com/python/cpython/commit/fdd6e0bf18517c3dc5e24c48fbfe890229fad1b5 --

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-25 Thread Steven D'Aprano
On Sun, 24 Jun 2018 10:46:09 -0700, Jim Lee wrote: > On 06/24/2018 04:35 AM, Steven D'Aprano wrote: >> >> Indeed. That's one of the beauties of Python -- even when there's an >> advanced way to do it, there's generally a simple way too. >> >> > What happened to the Python maxim "There should be

[issue33930] Segfault with deep recursion into object().__dir__

2018-06-25 Thread Ronald Oussoren
Ronald Oussoren added the comment: The crash is likely caused by recursion during the clean-up of the object().__dir__.__dir__ chain. The trashcan API (see Py_TRASHCAN_SAFE_BEGIN/Py_TRASHCAN_SAFE_END in Include/object.h) can help here. Those do some real work and have a cost, I can't

[issue33934] locale.getlocale() seems wrong when the locale is yet unset (python3 on linux)

2018-06-25 Thread Nick Coghlan
Nick Coghlan added the comment: Ah, part of the confusion is that I misremembered the command we run implicitly during startup - it's only `setlocale(LC_CTYPE, "")`, not `setlocale(LC_ALL, "")`. However, the default category for `locale.getlocale()` is `LC_CTYPE`, so it reports the text

[issue33952] doc Fix typo in str.upper() documentation

2018-06-25 Thread Tal Einat
Tal Einat added the comment: Thanks for the PR, Andrés! Merged and backported. -- ___ Python tracker ___ ___ Python-bugs-list

[issue33952] doc Fix typo in str.upper() documentation

2018-06-25 Thread Tal Einat
Tal Einat added the comment: New changeset 78209734a0ecd1567f819d95314b1c7c9b26f48a by Tal Einat in branch '2.7': [2.7] bpo-33952: Fix typo in str.upper() documentation (GH-7898) (GH-7905) https://github.com/python/cpython/commit/78209734a0ecd1567f819d95314b1c7c9b26f48a --

[issue33952] doc Fix typo in str.upper() documentation

2018-06-25 Thread Tal Einat
Tal Einat added the comment: New changeset ac5a6e35ef4a73846136804fff924760ec67ebbd by Tal Einat (Miss Islington (bot)) in branch '3.6': bpo-33952: Fix typo in str.upper() documentation (GH-7898) (GH-7904) https://github.com/python/cpython/commit/ac5a6e35ef4a73846136804fff924760ec67ebbd

[issue33952] doc Fix typo in str.upper() documentation

2018-06-25 Thread Tal Einat
Tal Einat added the comment: New changeset 80f1a908a87e55c318776fb8e6f8c21d8a8664ef by Tal Einat (Miss Islington (bot)) in branch '3.7': bpo-33952: Fix typo in str.upper() documentation (GH-7898) (GH-7903) https://github.com/python/cpython/commit/80f1a908a87e55c318776fb8e6f8c21d8a8664ef

[issue33952] doc Fix typo in str.upper() documentation

2018-06-25 Thread Tal Einat
Change by Tal Einat : -- pull_requests: +7511 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33952] doc Fix typo in str.upper() documentation

2018-06-25 Thread miss-islington
Change by miss-islington : -- pull_requests: +7510 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33943] doc Add references to logging.basicConfig

2018-06-25 Thread Tal Einat
Tal Einat added the comment: Thanks for the PR, Andrés! Merged and backported. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement ___ Python tracker

[issue33952] doc Fix typo in str.upper() documentation

2018-06-25 Thread miss-islington
Change by miss-islington : -- pull_requests: +7509 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33952] doc Fix typo in str.upper() documentation

2018-06-25 Thread Tal Einat
Tal Einat added the comment: New changeset 4a6e746079441d18c30e3c4d014f106faaf7792f by Tal Einat (Andrés Delfino) in branch 'master': bpo-33952: Fix typo in str.upper() documentation (GH-7898) https://github.com/python/cpython/commit/4a6e746079441d18c30e3c4d014f106faaf7792f -- nosy:

Re: syntax difference

2018-06-25 Thread Bart
On 25/06/2018 01:52, Steven D'Aprano wrote: On Sun, 24 Jun 2018 21:21:57 +0100, Bart wrote: I've had half a dozen users Come back when you've had *half a million users* then we'll take your experiences seriously. That being the case with Python (maybe even ten times as many), why would

Re: [ANN] pdfposter 0.7

2018-06-25 Thread jkn
On Sunday, June 24, 2018 at 10:02:05 PM UTC+1, Hartmut Goebel wrote: > I'm pleased to announce pdftools.pdfposter 0.7, a tool to scale and > tile PDF images/pages to print on multiple pages. > > :Homepage: https://pdfposter.readthedocs.io/ > :Author:   Hartmut Goebel > :Licence:  GNU Public

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-25 Thread Abdur-Rahmaan Janhangeer
we must maybe fibd an example where both are pythonic but one is simpler unless my type of example was intented by @steve Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ > -- https://mail.python.org/mailman/listinfo/python-list

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-25 Thread Alister via Python-list
On Mon, 25 Jun 2018 11:36:25 +0400, Abdur-Rahmaan Janhangeer wrote: > i think he means like for a loop to iterate over a list you might do > > list = [1,2,3] > for i in range(len(list)): > print(list[i]) > > > but the you might as well go for the simpler : > > > for elem in list: > >

[issue3971] s_push: parser stack overflow MemoryError

2018-06-25 Thread ait
ait added the comment: Also affected, a code generator produced deeply nested code with the structure depicted below and then crashed: #!/usr/bin/python2 -BEsStt

[issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error

2018-06-25 Thread STINNER Victor
Change by STINNER Victor : -- versions: +Python 3.6, Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue33934] locale.getlocale() seems wrong when the locale is yet unset (python3 on linux)

2018-06-25 Thread STINNER Victor
STINNER Victor added the comment: When testing this issue, I found a bug in Python :-( I opened bpo-33954: float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error. -- ___ Python tracker

[issue33954] float.__format__('n') fails with _PyUnicode_CheckConsistency assertion error

2018-06-25 Thread STINNER Victor
New submission from STINNER Victor : Example: vstinner@apu$ ./python Python 3.8.0a0 (heads/master-dirty:bcd3a1a18d, Jun 23 2018, 10:31:03) [GCC 8.1.1 20180502 (Red Hat 8.1.1-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>>

<    1   2   3   >