Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-21 Thread Edmondo Giovannozzi
Il giorno lunedì 20 marzo 2023 alle 19:10:26 UTC+1 Thomas Passin ha scritto: > On 3/20/2023 11:21 AM, Edmondo Giovannozzi wrote: > > > >>> def sum1(): > >>> s = 0 > >>> for i in range(100): > >>> s += i > >>> return s > >>> > >>> def sum2(): > >>> return sum(range(100)) > >> Here

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-20 Thread Thomas Passin
On 3/20/2023 11:21 AM, Edmondo Giovannozzi wrote: def sum1(): s = 0 for i in range(100): s += i return s def sum2(): return sum(range(100)) Here you already have the numbers you want to add. Actually using numpy you'll be much faster in this case: § imp

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-20 Thread MRAB
On 2023-03-20 15:21, Edmondo Giovannozzi wrote: > def sum1(): > s = 0 > for i in range(100): > s += i > return s > > def sum2(): > return sum(range(100)) Here you already have the numbers you want to add. Actually using numpy you'll be much faster in thi

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-20 Thread Edmondo Giovannozzi
> > def sum1(): > > s = 0 > > for i in range(100): > > s += i > > return s > > > > def sum2(): > > return sum(range(100)) > Here you already have the numbers you want to add. Actually using numpy you'll be much faster in this case: § import numpy as np § d

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-18 Thread Peter J. Holzer
On 2023-03-15 17:09:52 +, Weatherby,Gerard wrote: > Sum is faster than iteration in the general case. I'd say this is the special case, not the general case. > def sum1(): > s = 0 > for i in range(100): > s += i > return s > > def sum2(): > return sum(range(10

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-16 Thread Roel Schroeven
Op 14/03/2023 om 8:48 schreef Alexander Nestorov: I have the following code: ... for i in range(151): # 150 iterations    ... Nothing to do with your actual question and it's probably just a small oversight, but still I thought it was worth a mention: that comment does not accu

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-15 Thread Weatherby,Gerard
.timeit(sum2, number=100)) --- For Loop Sum: 6.984986504539847 Built-in Sum: 0.5175364706665277 From: Weatherby,Gerard Date: Wednesday, March 15, 2023 at 1:09 PM To: python-list@python.org Subject: Re: Debugging reason for python running unreasonably slow when adding numbers Sum is faster t

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-15 Thread Weatherby,Gerard
Wednesday, March 15, 2023 at 11:46 AM To: python-list@python.org Subject: RE: Debugging reason for python running unreasonably slow when adding numbers *** Attention: This is an external email. Use caution responding, opening attachments or clicking on links. *** > Then I'm very confuse

RE: Debugging reason for python running unreasonably slow when adding numbers

2023-03-15 Thread David Raymond
> Then I'm very confused as to how things are being done, so I will shut > up. There's not enough information here to give performance advice > without actually being a subject-matter expert already. Short version: In this specific case "weights" is a 5,147 element list of floats, and "input" is

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-15 Thread Chris Angelico
On Thu, 16 Mar 2023 at 02:14, Thomas Passin wrote: > > On 3/15/2023 11:01 AM, Chris Angelico wrote: > > On Thu, 16 Mar 2023 at 01:26, David Raymond > > wrote: > >> I'm not quite sure why the built-in sum functions are slower than the for > >> loop, > >> or why they're slower with the generator

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-15 Thread Thomas Passin
On 3/15/2023 11:01 AM, Chris Angelico wrote: On Thu, 16 Mar 2023 at 01:26, David Raymond wrote: I'm not quite sure why the built-in sum functions are slower than the for loop, or why they're slower with the generator expression than with the list comprehension. For small-to-medium data sizes

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-15 Thread Thomas Passin
On 3/15/2023 10:24 AM, David Raymond wrote: Or use the sum() builtin rather than reduce(), which was *deliberately* removed from the builtins. The fact that you can get sum() without importing, but have to go and reach for functools to get reduce(), is a hint that you probably shouldn't use reduc

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-15 Thread Chris Angelico
On Thu, 16 Mar 2023 at 01:26, David Raymond wrote: > I'm not quite sure why the built-in sum functions are slower than the for > loop, > or why they're slower with the generator expression than with the list > comprehension. For small-to-medium data sizes, genexps are slower than list comps, bu

RE: Debugging reason for python running unreasonably slow when adding numbers

2023-03-15 Thread David Raymond
> Or use the sum() builtin rather than reduce(), which was > *deliberately* removed from the builtins. The fact that you can get > sum() without importing, but have to go and reach for functools to get > reduce(), is a hint that you probably shouldn't use reduce when sum > will work. Out of curios

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-14 Thread Oscar Benjamin
On Tue, 14 Mar 2023 at 16:27, Alexander Nestorov wrote: > > I'm working on an NLP and I got bitten by an unreasonably slow behaviour in > Python while operating with small amounts of numbers. > > I have the following code: > > ```python > import random, time > from functools import reduce > > def

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-14 Thread Chris Angelico
On Wed, 15 Mar 2023 at 08:53, Peter J. Holzer wrote: > > On 2023-03-14 16:48:24 +0900, Alexander Nestorov wrote: > > I'm working on an NLP and I got bitten by an unreasonably slow > > behaviour in Python while operating with small amounts of numbers. > > > > I have the following code: > [...] > >

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-14 Thread Peter J. Holzer
On 2023-03-14 16:48:24 +0900, Alexander Nestorov wrote: > I'm working on an NLP and I got bitten by an unreasonably slow > behaviour in Python while operating with small amounts of numbers. > > I have the following code: [...] >       # 12x slower than equivalent JS >       sum_ = 0 >       for ke

Re: Debugging reason for python running unreasonably slow when adding numbers

2023-03-14 Thread Thomas Passin
On 3/14/2023 3:48 AM, Alexander Nestorov wrote: I'm working on an NLP and I got bitten by an unreasonably slow behaviour in Python while operating with small amounts of numbers. I have the following code: ```python import random, time from functools import reduce def trainPerceptron(perceptro

Debugging reason for python running unreasonably slow when adding numbers

2023-03-14 Thread Alexander Nestorov
I'm working on an NLP and I got bitten by an unreasonably slow behaviour in Python while operating with small amounts of numbers. I have the following code: ```python import random, time from functools import reduce def trainPerceptron(perceptron, data):   learningRate = 0.002   weights = perce

Re: Debugging Python C extensions with GDB

2022-11-15 Thread Barry
out a specific use of gdb for python c extensions. Barry > > > Nov 14, 2022, 14:32 by ba...@barrys-emacs.org: > > On 14 Nov 2022, at 19:10, Jen Kris via Python-list > wrote: > > In September 2021, Victor Stinner wrote “Debugging Python C extensions with > GDB”

Re: Debugging Python C extensions with GDB

2022-11-14 Thread Jen Kris via Python-list
;> In September 2021, Victor Stinner wrote “Debugging Python C extensions with >> GDB” >> (https://developers.redhat.com/articles/2021/09/08/debugging-python-c-extensions-gdb#getting_started_with_python_3_9). >> >> >> My question is: with Python 3.9+, can I

Re: Debugging Python C extensions with GDB

2022-11-14 Thread Barry
> On 14 Nov 2022, at 19:10, Jen Kris via Python-list > wrote: > > In September 2021, Victor Stinner wrote “Debugging Python C extensions with > GDB” > (https://developers.redhat.com/articles/2021/09/08/debugging-python-c-extensions-gdb#getting_started_with_python_

Debugging Python C extensions with GDB

2022-11-14 Thread Jen Kris via Python-list
In September 2021, Victor Stinner wrote “Debugging Python C extensions with GDB” (https://developers.redhat.com/articles/2021/09/08/debugging-python-c-extensions-gdb#getting_started_with_python_3_9).   My question is:  with Python 3.9+, can I debug into a C extension written in pure C and

Re: Debugging automatic quotation in subprocess.Popen()

2022-10-07 Thread Eryk Sun
On 10/7/22, c.bu...@posteo.jp wrote: > > I need to improve my understanding about how subprocess.Popen() does > quote arguments. I have special case here. > > Simple example: > Popen(['ls', '-l']) results on a shell in "ls -l" without quotation. The shell is only used if Popen is instantiated wit

Re: Debugging automatic quotation in subprocess.Popen()

2022-10-07 Thread Chris Angelico
On Sat, 8 Oct 2022 at 08:24, wrote: > > Hello, > > I need to improve my understanding about how subprocess.Popen() does > quote arguments. I have special case here. > > Simple example: > Popen(['ls', '-l']) results on a shell in "ls -l" without quotation. > > Quotes are added if they are needed: >

Debugging automatic quotation in subprocess.Popen()

2022-10-07 Thread c.buhtz
Hello, I need to improve my understanding about how subprocess.Popen() does quote arguments. I have special case here. Simple example: Popen(['ls', '-l']) results on a shell in "ls -l" without quotation. Quotes are added if they are needed: Popen(['ls', 'folder with blank']) results on a shell i

Re: Flush / update GUIs in PyQt5 during debugging in PyCharm

2021-09-26 Thread Mohsen Owzar
lors and > > their states as well. > > Because my program doesn't function correctly, I try to debug it in my IDE > > (PyCharm). > > The problem is that during debugging, when I change some attributes of a > > button or label, let say its background-color, I ca

Re: Flush / update GUIs in PyQt5 during debugging in PyCharm

2021-09-24 Thread DFS
g it in my IDE (PyCharm). The problem is that during debugging, when I change some attributes of a button or label, let say its background-color, I can not see this modification of the color until the whole method or function is completed. I believe that I have seen somewhere during my searches an

Flush / update GUIs in PyQt5 during debugging in PyCharm

2021-09-23 Thread Mohsen Owzar
hat during debugging, when I change some attributes of a button or label, let say its background-color, I can not see this modification of the color until the whole method or function is completed. I believe that I have seen somewhere during my searches and googling that one can flush or update the

Re: advice on debugging a segfault

2021-01-18 Thread Robin Becker
On 17/01/2021 21:35, Stestagg wrote: I would normally agree, except... This is a refcount issue (I was able to reproduce the problem, gbd shows a free error ) And I wouldn't recommend DGBing a refcount issue as a beginner to debugging. The other mailing list identified a PIL bug that m

Re: advice on debugging a segfault

2021-01-17 Thread Stestagg
I would normally agree, except... This is a refcount issue (I was able to reproduce the problem, gbd shows a free error ) And I wouldn't recommend DGBing a refcount issue as a beginner to debugging. The other mailing list identified a PIL bug that messes up the refcount for True, but

Re: advice on debugging a segfault

2021-01-17 Thread Barry
Run python under gdb and when the segv happens use the gdb bt command to get a stack trace. Also if gdb says that it needs debug symbols install you will need to do that. Otherwise the not will not contain symbols. Barry > On 17 Jan 2021, at 19:58, Robin Becker wrote: > > I have a segfault i

advice on debugging a segfault

2021-01-17 Thread Robin Becker
I have a segfault in the 3.10 alpha 4 when running the reportlab document generation; all the other tests seem to have worked. I would like to ask experts here how to approach getting the location of the problem. I run recent archlinux. Below is the output of a test run with -Xdev -Xtracemalloc

How to record full error message for debugging with nbconvert?

2020-11-28 Thread Shaozhong SHI
Hi, When I use nbconvert to run Jupyter notebook, it is so difficult to see the full error message for debugging? How to save full error messages? Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Re: Debugging native cython module with visual studio toolchain

2020-11-14 Thread Dan Stromberg
I can happily say I haven't used a Microsoft compiler/linker in decades, but: 1) Maybe clang-cl will do what you want? 2) Maybe it'd be easier to put debugging print's/printf's/cout <<'s in your code? HTH On Sat, Nov 14, 2020 at 1:55 PM Jeff wrote: > >

Debugging native cython module with visual studio toolchain

2020-11-14 Thread Jeff
> > Hi, > > We developed a Python module that interfaces with native code via Cython. > > We currently build on Windows with Visual Studio Toolchain. > > We encounter the following issues when trying to build a debug version: > > 1) 3rd party modules installed via PIP are Release mode, but Visual S

Re: Debugging a memory leak

2020-10-23 Thread Dieter Maurer
Pasha Stetsenko wrote at 2020-10-23 11:32 -0700: > ... > static int my_init(PyObject*, PyObject*, PyObject*) { return 0; } > static void my_dealloc(PyObject*) {} I think, the `dealloc` function is responsible to actually free the memory area. I see for example: static void Spec_dealloc(Spec* se

Re: Debugging a memory leak

2020-10-23 Thread Pasha Stetsenko
Thanks MRAB, this was it. I guess I was thinking about tp_dealloc as a C++ destructor, where the base class' destructor is called automatically. On Fri, Oct 23, 2020 at 11:59 AM MRAB wrote: > On 2020-10-23 19:32, Pasha Stetsenko wrote: > > Thanks for all the replies! > > Following Chris's advice

Re: Debugging a memory leak

2020-10-23 Thread MRAB
On 2020-10-23 19:32, Pasha Stetsenko wrote: Thanks for all the replies! Following Chris's advice, I tried to reduce the code to the smallest reproducible example (I guess I should have done it sooner), but here's what I came up with: ``` #include #include static int my_init(PyObject*,

Re: Debugging a memory leak

2020-10-23 Thread Pasha Stetsenko
Thanks for all the replies! Following Chris's advice, I tried to reduce the code to the smallest reproducible example (I guess I should have done it sooner), but here's what I came up with: ``` #include #include static int my_init(PyObject*, PyObject*, PyObject*) { return 0; } static voi

Re: Debugging a memory leak

2020-10-23 Thread Dieter Maurer
Pasha Stetsenko wrote at 2020-10-22 17:51 -0700: > ... >I'm a maintainer of a python library "datatable" (can be installed from >PyPi), and i've been recently trying to debug a memory leak that occurs in >my library. >The program that exposes the leak is quite simple: >``` >import datatable as dt >

Re: Debugging a memory leak

2020-10-22 Thread Karen Shaeffer via Python-list
> On Oct 22, 2020, at 5:51 PM, Pasha Stetsenko wrote: > > Dear Python gurus, > > I'm a maintainer of a python library "datatable" (can be installed from > PyPi), and i've been recently trying to debug a memory leak that occurs in > my library. > The program that exposes the leak is quite simp

Re: Debugging a memory leak

2020-10-22 Thread Chris Angelico
On Fri, Oct 23, 2020 at 12:20 PM Pasha Stetsenko wrote: > I'm currently not sure where to go from here. Is there something wrong with > my python object that prevents it from being correctly processed by the > Python runtime? Because this doesn't seem to be the usual case of > incrementing the ref

Debugging a memory leak

2020-10-22 Thread Pasha Stetsenko
Dear Python gurus, I'm a maintainer of a python library "datatable" (can be installed from PyPi), and i've been recently trying to debug a memory leak that occurs in my library. The program that exposes the leak is quite simple: ``` import datatable as dt import gc # just in case def leak(n=10**

Re: Debugging technique

2020-10-05 Thread J. Pic
Another nice debugger feature is to step up with "u", this will take you to the parent frame where you can again inspect the variables. I use this when I want to reverse engineer how the interpreter got to a specific line. Maybe worth mentioning that Werkzeug provides in-browser interactive debug

Re: Debugging technique

2020-10-03 Thread Irv Kalb
This probably is not for you. But PyCharm has a panel that shows a stack trace. I created a video about debugging using the PyCharm debugger. Here is a YouTube link: https://www.youtube.com/watch?v=cxAOSQQwDJ4 <https://www.youtube.com/watch?v=cxAOSQQwDJ4> Irv > On Oct 2, 2020, at

Re: Debugging technique

2020-10-03 Thread Frank Millman
On 2020-10-03 8:58 AM, Chris Angelico wrote: On Sat, Oct 3, 2020 at 4:53 PM Frank Millman wrote: Hi all When debugging, I sometimes add a 'breakpoint()' to my code to examine various objects. However, I often want to know how I got there, so I replace the 'breakpoint()&#x

Re: Debugging technique

2020-10-03 Thread Chris Angelico
On Sat, Oct 3, 2020 at 4:53 PM Frank Millman wrote: > > Hi all > > When debugging, I sometimes add a 'breakpoint()' to my code to examine > various objects. > > However, I often want to know how I got there, so I replace the > 'breakpoint()' with a &#x

Debugging technique

2020-10-02 Thread Frank Millman
Hi all When debugging, I sometimes add a 'breakpoint()' to my code to examine various objects. However, I often want to know how I got there, so I replace the 'breakpoint()' with a '1/0', to force a traceback at that point. Then I can rerun the previous step

Mixed Python/C debugging

2019-11-30 Thread Skip Montanaro
After at least ten years away from Python's run-time interpreter & byte code compiler, I'm getting set to familiarize myself with that again. This will, I think, entail debugging a mixed Python/C environment. I'm an Emacs user and am aware that GDB since 7.0 has support for debu

Is pdb suitable for debugging asyncio module?

2018-04-04 Thread jfong
I have a module below and run it under pdb, the result seems not easy to xplain. (Note: the sleep periods are in reverse order) --- # asyncio_as_completed.py import asyncio @asyncio.coroutine def phase(i): print('in phase {}'.format(i)) yield from asyncio.sleep(0.5 - (0.1 * i)

PyDev 5.8.0: Code Coverage fixes, IronPython debugging

2017-06-08 Thread Fabio Zadrozny
PyDev 5.8.0 Release Highlights - *Important* PyDev now requires Java 8 and Eclipse 4.6 (Neon) onwards. - PyDev 5.2.0 is the last release supporting Eclipse 4.5 (Mars). - *Code Analysis* - Fixed issue getting existing PyLint markers. - There's now an Info and an Ignore lev

Re: Help debugging code - Negative lookahead problem

2017-02-26 Thread michael . gauthier . uni
WOW, many thanks guys, Peter, and MRAB, for your time, help, and explanations! Peter, yes, you're right, when things get too complicated I should definitely try to split things up, and thus split the difficulties (ah, Descartes... ^^), thanks for the advice! MRAB, your code is now working, than

Re: Help debugging code - Negative lookahead problem

2017-02-26 Thread MRAB
On 2017-02-26 17:15, michael.gauthier@gmail.com wrote: Hi MRAB, Thanks for taking time to look at my problem! I tried your solution: r"\d{2}\s?(?=(?:years old\s?|yo\s?|yr old\s?|y o\s?|yrs old\s?|year old\s?)(?!son|daughter|kid|child))" but unfortunately it does seem not work. Also, I tr

Re: Help debugging code - Negative lookahead problem

2017-02-26 Thread Peter Otten
michael.gauthier@gmail.com wrote: > Hi MRAB, > > Thanks for taking time to look at my problem! > > I tried your solution: > > r"\d{2}\s?(?=(?:years old\s?|yo\s?|yr old\s?|y o\s?|yrs old\s?|year > old\s?)(?!son|daughter|kid|child))" > > but unfortunately it does seem not work. Also, I trie

Re: Help debugging code - Negative lookahead problem

2017-02-26 Thread michael . gauthier . uni
Hi MRAB, Thanks for taking time to look at my problem! I tried your solution: r"\d{2}\s?(?=(?:years old\s?|yo\s?|yr old\s?|y o\s?|yrs old\s?|year old\s?)(?!son|daughter|kid|child))" but unfortunately it does seem not work. Also, I tried adding the negative lookaheads after every one of the a

Re: Help debugging code - Negative lookahead problem

2017-02-26 Thread MRAB
On 2017-02-26 14:13, michael.gauthier@gmail.com wrote: Hi everyone, So here is my problem. I have a bunch of tweets and various metadata that I want to analyze for sociolinguistic purposes. In order to do this, I'm trying to infer users' ages thanks to the information they provide in their

Help debugging code - Negative lookahead problem

2017-02-26 Thread michael . gauthier . uni
Hi everyone, So here is my problem. I have a bunch of tweets and various metadata that I want to analyze for sociolinguistic purposes. In order to do this, I'm trying to infer users' ages thanks to the information they provide in their bio, among others. For that I'm using regular expressions t

Re: Make sure you removed all debugging print statements error

2016-08-10 Thread Chris Angelico
On Thu, Aug 11, 2016 at 8:48 AM, Gregory Ewing wrote: > Chris Angelico wrote: >> >> I suppose you could put down Kelvin as a last name and either Baron or >> Lord as a first name, but that'd just be cheating... > > > Or put NULL as the first name and have fun watching > the database break. > > htt

Re: Make sure you removed all debugging print statements error

2016-08-10 Thread Gregory Ewing
Chris Angelico wrote: I suppose you could put down Kelvin as a last name and either Baron or Lord as a first name, but that'd just be cheating... Or put NULL as the first name and have fun watching the database break. http://www.wired.com/2015/11/null/ Or perhaps even profit: http://www.dail

Re: Make sure you removed all debugging print statements error

2016-08-10 Thread Chris Angelico
On Wed, Aug 10, 2016 at 8:21 PM, alister wrote: - but secondly, don't force people's names to be subdivided. >>> >>> I like the French convention >>> . >> >> I may not have a family name at all > > Damn this would have been an id

Re: Make sure you removed all debugging print statements error

2016-08-10 Thread alister
On Wed, 10 Aug 2016 09:23:40 +, alister wrote: > On Tue, 09 Aug 2016 19:53:56 -0700, Lawrence D’Oliveiro wrote: > >> On Tuesday, August 9, 2016 at 4:20:37 AM UTC+12, Chris Angelico wrote: >>> Firstly, the bare "except:" clause should basically never be used; >>> instead, catch a very specific

Re: Make sure you removed all debugging print statements error

2016-08-10 Thread alister
On Tue, 09 Aug 2016 19:53:56 -0700, Lawrence D’Oliveiro wrote: > On Tuesday, August 9, 2016 at 4:20:37 AM UTC+12, Chris Angelico wrote: >> Firstly, the bare "except:" clause should basically never be used; >> instead, catch a very specific exception and figure out what you want >> to do here > >

Re: Make sure you removed all debugging print statements error

2016-08-09 Thread Steven D'Aprano
On Wednesday 10 August 2016 12:53, Lawrence D’Oliveiro wrote: > On Tuesday, August 9, 2016 at 4:20:37 AM UTC+12, Chris Angelico wrote: >> Firstly, the bare "except:" clause should basically never be used; >> instead, catch a very specific exception and figure out what you want to >> do here > > Y

Re: Make sure you removed all debugging print statements error

2016-08-09 Thread Lawrence D’Oliveiro
On Tuesday, August 9, 2016 at 4:20:37 AM UTC+12, Chris Angelico wrote: > Firstly, the bare "except:" clause should basically never be used; > instead, catch a very specific exception and figure out what you want to > do here Yes. > - but secondly, don't force people's names to be subdivided. I l

Re: Make sure you removed all debugging print statements error

2016-08-08 Thread Michael Torrie
On 08/08/2016 06:20 AM, aaryanrevi...@gmail.com wrote: > Hello guys! I was answering a question on a piece of homework of > mine. Sadly I can't answer it correctly due to the repetitive error > being "Make sure you removed all debugging print statements." > Hopefully

Re: Make sure you removed all debugging print statements error

2016-08-08 Thread Chris Angelico
d idea - you're treating a person as equivalent to his/her name. Normally you'd define the repr and/or str of a class to show exactly what thing this is; it'll make debugging easier. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Make sure you removed all debugging print statements error

2016-08-08 Thread Christian Gollwitzer
Am 08.08.16 um 14:20 schrieb aaryanrevi...@gmail.com:> Hello guys! I was answering a question on a piece of homework of mine. Sadly I can't answer it correctly due to the repetitive error being "Make sure you removed all debugging print statements." Hopefully one of you guys

Re: Make sure you removed all debugging print statements error

2016-08-08 Thread Steven D'Aprano
On Mon, 8 Aug 2016 10:20 pm, aaryanrevi...@gmail.com wrote: > Hello guys! I was answering a question on a piece of homework of mine. > Sadly I can't answer it correctly due to the repetitive error being "Make > sure you removed all debugging print statements." Hopefully on

Make sure you removed all debugging print statements error

2016-08-08 Thread aaryanreviews
Hello guys! I was answering a question on a piece of homework of mine. Sadly I can't answer it correctly due to the repetitive error being "Make sure you removed all debugging print statements." Hopefully one of you guys can help me solve this and also make me understand why I

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-04 Thread Chris Angelico
On Fri, Aug 5, 2016 at 4:37 AM, Terry Reedy wrote: > Making repeat a keyword would have such an extremely high cost > that it is out of the question and not a sane proposal. > To start with, it is used in two major, widely used APIs. > > itertools.repeat + 50 uses in other itertools and tests > ti

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-04 Thread Terry Reedy
Making repeat a keyword would have such an extremely high cost that it is out of the question and not a sane proposal. To start with, it is used in two major, widely used APIs. itertools.repeat + 50 uses in other itertools and tests + all the imports and and uses of repeat() in code all over th

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-04 Thread Steven D'Aprano
On Thursday 04 August 2016 19:13, BartC wrote: > On 04/08/2016 04:23, Steven D'Aprano wrote: >> On Wed, 3 Aug 2016 08:16 pm, BartC wrote: > >>> So the idea that remembering 'repeat N' is a cognitive burden, and the >>> myriad string operations for example are not, is ridiculous. >> >> Who says it

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-04 Thread Chris Angelico
On Thu, Aug 4, 2016 at 7:13 PM, BartC wrote: > On 04/08/2016 04:23, Steven D'Aprano wrote: >> >> On Wed, 3 Aug 2016 08:16 pm, BartC wrote: > > >>> So the idea that remembering 'repeat N' is a cognitive burden, and the >>> myriad string operations for example are not, is ridiculous. >> >> >> Who sa

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-04 Thread BartC
On 04/08/2016 04:23, Steven D'Aprano wrote: On Wed, 3 Aug 2016 08:16 pm, BartC wrote: So the idea that remembering 'repeat N' is a cognitive burden, and the myriad string operations for example are not, is ridiculous. Who says it isn't a cognitive burden? Of course it is. The difference is

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-03 Thread Steven D'Aprano
On Wed, 3 Aug 2016 08:16 pm, BartC wrote: > On 03/08/2016 06:43, Steven D'Aprano wrote: > >> Not everything that is done is worth the cognitive burden of memorising a >> special case. > > >> In some ways, Python is a more minimalist language than you like. That's >> okay, you're allowed to

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-03 Thread Chris Angelico
On Wed, Aug 3, 2016 at 8:16 PM, BartC wrote: > On 03/08/2016 06:43, Steven D'Aprano wrote: > >> Not everything that is done is worth the cognitive burden of memorising a >> special case. > > > >> In some ways, Python is a more minimalist language than you like. That's >> okay, >> you're allow

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-03 Thread BartC
On 03/08/2016 06:43, Steven D'Aprano wrote: Not everything that is done is worth the cognitive burden of memorising a special case. In some ways, Python is a more minimalist language than you like. That's okay, you're allowed to disagree with some design decisions. Well it's minimalist

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread Steven D'Aprano
On Wednesday 03 August 2016 05:14, BartC wrote: > It's fundamental in that, when giving instructions or commands in > English, it frequently comes up when you want something done a set > number of times: > > "Give me 20 push-ups" At which point the person will invariable drop to the ground and s

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread BartC
On 02/08/2016 22:27, Terry Reedy wrote: On 8/2/2016 7:05 AM, BartC wrote: Your objection to a feature such as 'repeat N' doesn't really stack up. My objection is that there is a real cost that MUST be stacked up against the benefit. ... Anyway, if that was a valid objection, it would apply

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread Paul Rubin
Terry Reedy writes: > I think it is you who is unwilling to admit that nearly everything > that would be useful also has a cost, and that the ultimate cost of > adding every useful feature, especially syntax features, would be to > make python less unusable. I think you meant "usable" ;). Some o

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread Terry Reedy
ot use the loop variable, either as part of a modified computation or for monitoring or debugging purposes. print(i, for_body_result) Beginners are often atrocious at debugging, and it seems not to be taught hardly at all. 'repeat n' erects a barrier to debugging. Debugging: prob

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread Chris Angelico
On Wed, Aug 3, 2016 at 5:55 AM, Christian Gollwitzer wrote: >> - Arbitrary-precision non-integers > > > https://pypi.python.org/pypi/bigfloat/ > > ? Wasn't aware of that. Cool. Not that I need it very often (and when I do, I can use Pike, which has MPFR support built-in). Or I can use decimal.Dec

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread Christian Gollwitzer
Am 02.08.16 um 16:58 schrieb Chris Angelico: - A more free-form declarative syntax for laying out GUI code Actually, the Tkinter wrapper misses one feature of grid in Tcl/Tk: You can write something like grid .a .b grid .c .d to lay out a GUI 2x2 grid using "ASCII-art". There is a package i

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread Chris Angelico
On Wed, Aug 3, 2016 at 3:57 AM, Steven D'Aprano wrote: > On Wed, 3 Aug 2016 03:12 am, BartC wrote: > >> That's not a fundamental language feature. Repeat-N is. And if properly >> designed, isn't an extra feature at all but a special case of a generic >> loop. > > Which means it is NOT a fundamenta

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread BartC
On 02/08/2016 18:57, Steven D'Aprano wrote: On Wed, 3 Aug 2016 03:12 am, BartC wrote: That's not a fundamental language feature. Repeat-N is. And if properly designed, isn't an extra feature at all but a special case of a generic loop. Which means it is NOT a fundamental language feature. "R

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread Steven D'Aprano
On Wed, 3 Aug 2016 03:12 am, BartC wrote: > That's not a fundamental language feature. Repeat-N is. And if properly > designed, isn't an extra feature at all but a special case of a generic > loop. Which means it is NOT a fundamental language feature. "Repeat N without tracking the loop variable

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread BartC
On 02/08/2016 15:58, Chris Angelico wrote: On Tue, Aug 2, 2016 at 9:05 PM, BartC wrote: I think the real reason is not willing to admit that the language lacks something that could actually be useful, and especially not to an upstart on usenet who is not even an expert in that language. I kno

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread Chris Angelico
On Tue, Aug 2, 2016 at 9:05 PM, BartC wrote: > I think the real reason is not willing to admit that the language lacks > something that could actually be useful, and especially not to an upstart on > usenet who is not even an expert in that language. I know what features I miss from the languages

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-02 Thread BartC
part of a modified computation or for monitoring or debugging purposes. print(i, for_body_result) Beginners are often atrocious at debugging, and it seems not to be taught hardly at all. 'repeat n' erects a barrier to debugging. Debugging: probing a computation to see what

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-07-31 Thread Chris Angelico
On Mon, Aug 1, 2016 at 4:58 AM, Terry Reedy wrote: > > As for the original topic: Guido judged that a uniform rule "Compound > statement headers end with ':' and the next line has an additional indent" > would make correct code easier to write and parse and make it visually more > obvious. Some P

Debugging (was Re: Why not allow empty code blocks?)

2016-07-31 Thread Terry Reedy
ontraction is that one cannot use the loop variable, either as part of a modified computation or for monitoring or debugging purposes. print(i, for_body_result) Beginners are often atrocious at debugging, and it seems not to be taught hardly at all. 'repeat n' erects a

Re: debugging uwsgi

2016-01-08 Thread Robin Becker
On 08/01/2016 15:03, Robin Becker wrote: I have an unusual bug in a large django project which has appeared when using nginx + uwsgi + django. The configuration nginx + flup + django or the django runserver don't seem to create the conditions for the error. Basically I am seeing an error Trace

debugging uwsgi

2016-01-08 Thread Robin Becker
ommands.%s' % (app_name, 'fe_data_load')) in the manage.py shell work fine and sys.path looks as expected. The uwsgi worker process (I'm forking) is corrupted after (or perhaps because of ) this error and causes previously working pages to fail; it looks like the python interp

Re: Help with Debugging

2015-09-27 Thread Cai Gengyang
I am glad to announce that it works now ! The error was an addition random 'qq' that somehow appeared in my settings.py file on line 44. Once I spotted and removed it , the code works. I have pasted the entire successful piece of code here for viewing and discussion ... CaiGengYangs-MacBook-Pro

Re: Help with Debugging

2015-09-27 Thread Andrea D'Amore
On 2015-09-28 05:26:35 +, Cai Gengyang said: File "/Users/CaiGengYang/mysite/mysite/settings.py", line 45 'django.middleware.csrf.CsrfViewMiddleware', ^ SyntaxError: invalid syntax The syntax looks fine in the pastebin, did you possibl

Re: Help with Debugging

2015-09-27 Thread Cai Gengyang
This is my input and output error message (the whole thing) : CaiGengYangs-MacBook-Pro:~ CaiGengYang$ cd mysite folder CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ ls manage.pymysite CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ python manage.py migrate Traceback (most recent call

Re: Help with Debugging

2015-09-27 Thread Steven D'Aprano
On Mon, 28 Sep 2015 03:45 am, Cai Gengyang wrote: > http://pastebin.com/RWt1mp7F --- If anybody can find any errors with this > settings.py file, let me know ! > > Can't seem to find anything wrong with it ... Perhaps there is nothing wrong with it. What makes you think that there is? Do you ge

Help with Debugging

2015-09-27 Thread Cai Gengyang
http://pastebin.com/RWt1mp7F --- If anybody can find any errors with this settings.py file, let me know ! Can't seem to find anything wrong with it ... -- https://mail.python.org/mailman/listinfo/python-list

Re: debugging during package development

2015-08-01 Thread Sebastian Luque
On Sat, 01 Aug 2015 15:30:34 +1000, Ben Finney wrote: > Seb writes: >> With lots of debugging to do, the last thing I'd want is to worry >> about the search path. > Short answer: you need ‘python3 ./setup.py develop’. > Medium-length answer: you need to add some

  1   2   3   4   5   6   7   >