Re: Idiosyncratic python

2015-09-24 Thread Steven D'Aprano
On Thursday 24 September 2015 16:16, Paul Rubin wrote: > Steven D'Aprano writes: >> for k, v in mydict.items(): >> del(k) > > That looks wrong: it's deleting k from what? The local namespace. py> k = 23 py> print k 23 py> del k py> print k Traceback

[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-24 Thread STINNER Victor
STINNER Victor added the comment: I'm unable to reproduce the issue on Linux. I tried system python 3.4.2 and the development version of Python 3.6. First I tried with no MongoDB server running. Then I tried with a MongoDB server running. I also ran the pymongo test suite on Windows 8.1 with

Re: Idiosyncratic python

2015-09-24 Thread jmp
On 09/24/2015 08:02 AM, Steven D'Aprano wrote: I was looking at an in-house code base today, and the author seems to have a rather idiosyncratic approach to Python. For example: for k, v in mydict.items(): del(k) ... instead of the more obvious for v in mydict.values(): ...

[issue25223] Statically or dynamically linked to the VC++runtime ? or how Python install fails on Vista despite the VC redist packages - api-ms-win-crt-runtime-l1-1-0.dll

2015-09-24 Thread acx01bc
acx01bc added the comment: On Vista32bits, the VC++2015 redist package does install msvcr140.dll but none of the api-ms-win-crt-***-l1-1-0.dll, thus (that's why I opened this discussion at first) it is impossible to make many of the Python releases working, at least on Vista 32bits. There are

[issue25211] Error message formatting errors in int object unit-test script

2015-09-24 Thread Berker Peksag
Berker Peksag added the comment: subTest-long.patch looks good to me. Thanks! -- stage: patch review -> commit review ___ Python tracker ___

[issue25226] "suffix" attribute not documented in logging.TimedRotatingFileHandler

2015-09-24 Thread NobilisVir
New submission from NobilisVir: The suffix attribute that controls the timestamp portion that gets appended to the file name is not documented (but it would be very useful to be). The documentation is here - https://docs.python.org/2/library/logging.handlers.html#timedrotatingfilehandler I

Re: PyInstaller+ Python3.5 (h5py import error)

2015-09-24 Thread Heli Nix
Thanks Christian, It turned out that h5py.defs was not the only hidden import that I needed to add. I managed to get it working with the follwoing command adding 4 hidden imports. pyinstaller --hidden-import=h5py.defs --hidden-import=h5py.utils --hidden-import=h5py.h5ac

[issue21995] Idle: pseudofiles have no buffer attribute.

2015-09-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: I believe this issue was derived from another were someone complained about something else being missing. I will just look into the other two and see if they are supposed to be there. -- ___ Python tracker

Re: ConnectionError handling problem

2015-09-24 Thread Laura Creighton
In a message of Wed, 23 Sep 2015 19:49:17 -0700, shiva upreti writes: >Hi >If my script hangs because of the reasons you mentioned above, why doesnt it >catch ConnectionError? >My script stops for a while and when I press CTRL+C, it shows ConnectionError >without terminating the process, and the

[issue25208] improvements to the asyncio documentation

2015-09-24 Thread Andrew Svetlov
Andrew Svetlov added the comment: Fixed. Thanks! -- nosy: +asvetlov resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3.6 ___ Python tracker

Re: PyInstaller+ Python3.5 (h5py import error)

2015-09-24 Thread Laura Creighton
In a message of Thu, 24 Sep 2015 02:58:35 -0700, Heli Nix writes: >Thanks Christian, > >It turned out that h5py.defs was not the only hidden import that I needed to >add. > >I managed to get it working with the follwoing command adding 4 hidden >imports. > > >pyinstaller

[issue25208] improvements to the asyncio documentation

2015-09-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3909d29d29fc by Andrew Svetlov in branch '3.4': Fix #25208: Improve "Develop with asyncio" doc page. https://hg.python.org/cpython/rev/3909d29d29fc -- nosy: +python-dev ___ Python tracker

[issue25210] Special-case NoneType() in do_richcompare()

2015-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And this is the only case where type name followed with '()' is occurred in error message. The repr() shouldn't be used in error message because it can be too long (imagine 'x'*10**9 < None) and can raise an exception. IMHO more correct would be message

[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-24 Thread STINNER Victor
STINNER Victor added the comment: Bernie Hackett wrote: "Feel free to close this won't fix, but given that this appears to be the second report of this issue for 3.5 (see issue22971) ..." It's not because you get the same error message that the root cause is the same. Martin Panter wrote: "I

[issue24894] iso-8859-11 missing from codecs table

2015-09-24 Thread Ezio Melotti
Ezio Melotti added the comment: Thanks Prashant for the patch and Victor for taking care of it! -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed versions: +Python 2.7, Python 3.4 ___ Python tracker

[issue21995] Idle: pseudofiles have no buffer attribute.

2015-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: https://docs.python.org/3/library/io.html#io.TextIOBase.buffer """buffer The underlying binary buffer (a BufferedIOBase instance) that TextIOBase deals with. This is not part of the TextIOBase API and may not exist in some implementations.""" It is common

[issue25210] Special-case NoneType() in do_richcompare()

2015-09-24 Thread STINNER Victor
STINNER Victor added the comment: +1 to remove parenthesis from type names in the error message. But from all types, not only NoneType. -- ___ Python tracker

[issue22032] Use __qualname__ together with __module__

2015-09-24 Thread STINNER Victor
STINNER Victor added the comment: Barry, Robert: I'm sorry that the change broke tests, but tests should not rely on the exact representation. They can test type(obj).__name__ for example. Barry: "people should be aware that this can break doctests" Some years ago, I was a big fan of doctest.

[issue22032] Use __qualname__ together with __module__

2015-09-24 Thread STINNER Victor
STINNER Victor added the comment: Oh by the way, this issue is closed, what do you expect Barry and Robert? If you consider that it's a bug, please open a new issue and describe what you want :-) -- ___ Python tracker

Re: Idiosyncratic python

2015-09-24 Thread Ben Finney
Steven D'Aprano writes: > On Thursday 24 September 2015 16:16, Paul Rubin wrote: > > > Steven D'Aprano writes: > >> for k, v in mydict.items(): > >> del(k) > > […] The obvious intent is to iterate over the *values*

[issue24894] iso-8859-11 missing from codecs table

2015-09-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset aa9e0dcbbcc2 by Victor Stinner in branch '3.4': Issue #24894: Document the codec iso8859_11 https://hg.python.org/cpython/rev/aa9e0dcbbcc2 New changeset 84a918335fe5 by Victor Stinner in branch '3.5': Merge 3.4 (codecs, issue #24894)

[issue24894] iso-8859-11 missing from codecs table

2015-09-24 Thread STINNER Victor
STINNER Victor added the comment: > That was mistake in previous patch,so here is new patch for the same. Don't be sorry, that's why we have reviews :-) +| iso8859_11 | iso-8856-11, iso-8859-11-2001, | Thai languages | +| | thai

Re: Idiosyncratic python

2015-09-24 Thread Terry Reedy
On 9/24/2015 2:35 AM, Steven D'Aprano wrote: On Thursday 24 September 2015 16:16, Paul Rubin wrote: Steven D'Aprano writes: for k, v in mydict.items(): del(k) That looks wrong: it's deleting k from what? The local namespace. py> k = 23 py>

[issue21995] Idle: pseudofiles have no buffer attribute.

2015-09-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset ac6ade0c5927 by Terry Jan Reedy in branch '2.7': Issue 21995: Explain some differences between IDLE and console Python. https://hg.python.org/cpython/rev/ac6ade0c5927 New changeset ca6c9cc77c20 by Terry Jan Reedy in branch '3.4': Issue 21995:

Idiosyncratic python

2015-09-24 Thread Steven D'Aprano
I was looking at an in-house code base today, and the author seems to have a rather idiosyncratic approach to Python. For example: for k, v in mydict.items(): del(k) ... instead of the more obvious for v in mydict.values(): ... What are your favorite not-wrong-just-weird

[issue25210] Special-case NoneType() in do_richcompare()

2015-09-24 Thread Ezio Melotti
Ezio Melotti added the comment: This case is different from most of the others though, because while it talks about unorderable types, it provides an example showing two instances (hence the parentheses). In these NoneType is correct: >>> int(None) TypeError: int() argument must be a string

Re: Idiosyncratic python

2015-09-24 Thread Paul Rubin
Steven D'Aprano writes: > for k, v in mydict.items(): > del(k) That looks wrong: it's deleting k from what? > instead of the more obvious > for v in mydict.values(): > ... Maybe you mean while mydict: k, v = mydict.popitem() ...

[issue22032] Use __qualname__ together with __module__

2015-09-24 Thread Robert Kuska
Robert Kuska added the comment: FYI This also broke nosetests tests which relies on exact output. https://github.com/nose-devs/nose/issues/928 -- nosy: +rkuska ___ Python tracker

[issue24894] iso-8859-11 missing from codecs table

2015-09-24 Thread Prashant Tyagi
Prashant Tyagi added the comment: Typo error is very silly,because i am new to this developement of python foundation .next time i will try my best. On Thu, Sep 24, 2015 at 12:37 PM, STINNER Victor wrote: > > STINNER Victor added the comment: > > > That was mistake in

[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The json code was almost not changed, so it can be related to changes in import machinery or in ceval.c if they consume more stack than previous. Yet one suspect is Argument Clinic that adds additional wrappers. -- nosy: +serhiy.storchaka

[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-24 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka added the comment: > The json code was almost not changed, so it can be related to changes in > import machinery or in ceval.c if they consume more stack than previous. > > Yet one suspect is Argument Clinic that adds additional wrappers. This

[issue25206] PEP 498: Minor mistakes/outdateness

2015-09-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7e32da8da58e by Eric V. Smith in branch 'default': Issue 25206: fix f-string exceptions to match the code. https://hg.python.org/peps/rev/7e32da8da58e -- ___ Python tracker

[issue25206] PEP 498: Minor mistakes/outdateness

2015-09-24 Thread Eric V. Smith
Changes by Eric V. Smith : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

Re: Python, convert an integer into an index?

2015-09-24 Thread Anssi Saari
Dennis Lee Bieber writes: > On Wed, 23 Sep 2015 00:21:22 +0200, Laura Creighton > declaimed the following: > > >> >>You need to convert your results into a string first. >> >>result_int=1234523 >>result_list=[] >> >>for digit in str(result_int): >>

querying hive database using python

2015-09-24 Thread heenameena1234
I have server A and Server B. Server B is a hadoop cluster which has hive database and etc.. Server A has python 2.7. I would like to write a hive query using python on Server A to pull data from Server B. Server A and B has connectivity and no issues with network etc.. I have installed all

[issue25227] Optimize ASCII/latin1 encoder with surrogateescape error handlers

2015-09-24 Thread STINNER Victor
Changes by STINNER Victor : -- keywords: +patch Added file: http://bugs.python.org/file40562/encode_ucs1_surrogateescape.patch ___ Python tracker

[issue25223] Statically or dynamically linked to the VC++runtime ? or how Python install fails on Vista despite the VC redist packages - api-ms-win-crt-runtime-l1-1-0.dll

2015-09-24 Thread Steve Dower
Steve Dower added the comment: msvcr140.dll does not exist and was never released. I'm not sure what you've installed, but it seems to be the wrong thing. I'm familiar with the compiler options and we are using the correct ones. If you want to change them, you should build your own copy. To

[issue25209] Append space after completed keywords

2015-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > “Else” doesn’t always use a colon. Consider “1 if x else 2”. Good catch Martin. Unfortunately the completer doesn't take context into account. "else" with a colon is a common case, but unwanted colon could be annoyed. I agree that it would be safe to not

[issue25227] Optimize ASCII/latin1 encoder with surrogateescape error handlers

2015-09-24 Thread STINNER Victor
New submission from STINNER Victor: Attached patch is based on faster_surrogates_hadling.patch written by Serhiy Storchaka for the issue #24870. It optimizes str.encode('ascii', 'surrogateescape') and str.encode('ascii', 'latin1'). -- messages: 251516 nosy: haypo priority: normal

Re: Sending a python argument to a Boost.Python function

2015-09-24 Thread Laura Creighton
Try that question here: https://mail.python.org/mailman/listinfo/cplusplus-sig Laura -- https://mail.python.org/mailman/listinfo/python-list

Re: Python, convert an integer into an index?

2015-09-24 Thread MRAB
On 2015-09-23 10:01, Anssi Saari wrote: Dennis Lee Bieber writes: On Wed, 23 Sep 2015 00:21:22 +0200, Laura Creighton declaimed the following: You need to convert your results into a string first. result_int=1234523 result_list=[] for digit in

[issue21295] Python 3.4 gives wrong col_offset for Call nodes returned from ast.parse

2015-09-24 Thread Radek Novacek
Radek Novacek added the comment: I've ran the tests from first and second comment using python 3.5.0 and it seems it produces correct results: >>> import ast >>> tree = ast.parse("sin(0.5)") >>> first_stmt = tree.body[0] >>> call = first_stmt.value >>> print("col_offset of call expression:",

[issue25227] Optimize ASCII/latin1 encoder with surrogateescape error handlers

2015-09-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset fa65c32d7134 by Victor Stinner in branch 'default': Issue #25227: Cleanup unicode_encode_ucs1() error handler https://hg.python.org/cpython/rev/fa65c32d7134 -- nosy: +python-dev ___ Python tracker

[issue25210] Special-case NoneType() in do_richcompare()

2015-09-24 Thread R. David Murray
R. David Murray added the comment: See issue 20077. IMO it should still say int < NoneType, to be consistent. I still don't see a reason to special case None here. -- ___ Python tracker

Re: Idiosyncratic python

2015-09-24 Thread paul.hermeneutic
> A lot of our in base weird python comes from heavily C-wired people: > > The classic > for i in range(len(alist)): > print alist[i] > > with its twin brother > > i=0 > while i < len(alist): > print alist[i] > i += 1 > > And the even more annoying > > result = Result() > getResult(result) >

Re: Idiosyncratic python

2015-09-24 Thread Mark Lawrence
On 24/09/2015 13:50, paul.hermeneu...@gmail.com wrote: > A lot of our in base weird python comes from heavily C-wired people: > > The classic > for i in range(len(alist)): > print alist[i] > > with its twin brother > > i=0 > while i < len(alist): > print alist[i] > i += 1 > >

[issue24870] Optimize coding with surrogateescape and surrogatepass error handlers

2015-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I worked on UTF-16 and UTF-32 encoders, but now I'm off my developing computer. I'll provide updated patch soon. I think that only "surrogateescape" and "surrogatepass" error handlers have need in optimization, because they are used to interpolate with

[issue16701] Docs missing the behavior of += (in-place add) for lists.

2015-09-24 Thread R. David Murray
R. David Murray added the comment: Something I missed on the first review: why did you change "the same as" to "usually the same as"? When is it different? -- ___ Python tracker

Re: Python, convert an integer into an index?

2015-09-24 Thread paul.hermeneutic
>> I'm suprised. Why not just: >> >> list(str(results)) >> >> In other words, is there something else the list constructor should do >> with a string other than convert it to a list? >> > The OP wanted the result to be a list of ints, not a list of strings. [int(x) for x in list(str(results))] --

[issue22032] Use __qualname__ together with __module__

2015-09-24 Thread STINNER Victor
STINNER Victor added the comment: Ok, anyway, thanks for your feedback. -- ___ Python tracker ___ ___

Re: Python, convert an integer into an index?

2015-09-24 Thread jmp
On 09/24/2015 03:45 PM, paul.hermeneu...@gmail.com wrote: >> I'm suprised. Why not just: >> >> list(str(results)) >> >> In other words, is there something else the list constructor should do >> with a string other than convert it to a list? >> > The OP wanted the result to be a list of

Installing pywin32.

2015-09-24 Thread ashwath
Hi Sir/Madam When I try to run my python program where I am using the pywin32 module I am getting the error as win32api module not found so how to install this module please let me know ASP. Thank You Ashwath B H -- https://mail.python.org/mailman/listinfo/python-list

[issue24870] Optimize ascii and latin1 decoder with surrogateescape and surrogatepass error handlers

2015-09-24 Thread STINNER Victor
Changes by STINNER Victor : -- title: Optimize coding with surrogateescape and surrogatepass error handlers -> Optimize ascii and latin1 decoder with surrogateescape and surrogatepass error handlers ___ Python tracker

[issue24870] Optimize ascii and latin1 decoder with surrogateescape and surrogatepass error handlers

2015-09-24 Thread STINNER Victor
STINNER Victor added the comment: Serhiy wrote: "All other error handlers lose information and can't be used per se for transcoding bytes as string or string as bytes." Well, it was very simple to implement replace and ignore in decoders. I believe that the error handlers are commonly used.

[issue25210] Fix do_richcompare() error message: remove parenthesis from type names

2015-09-24 Thread STINNER Victor
Changes by STINNER Victor : -- title: Special-case NoneType() in do_richcompare() -> Fix do_richcompare() error message: remove parenthesis from type names ___ Python tracker

Re: Idiosyncratic python

2015-09-24 Thread jmp
On 09/24/2015 02:50 PM, paul.hermeneu...@gmail.com wrote: > A lot of our in base weird python comes from heavily C-wired people: > > The classic > for i in range(len(alist)): > print alist[i] > > with its twin brother > > i=0 > while i < len(alist): > print alist[i] > i += 1 >

[issue25227] Optimize ASCII/latin1 encoder with surrogateescape error handlers

2015-09-24 Thread STINNER Victor
STINNER Victor added the comment: Result of a micro-benchmark with encode_ucs1_surrogateescape-2.patch. Common platform: Timer info: namespace(adjustable=False, implementation='clock_gettime(CLOCK_MONOTONIC)', monotonic=True, resolution=1e-09) Timer: time.perf_counter CPU model: Intel(R)

[issue25210] Special-case NoneType() in do_richcompare()

2015-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: int < NoneType is not the same as int() < None. -- title: Fix do_richcompare() error message: remove parenthesis from type names -> Special-case NoneType() in do_richcompare() ___ Python tracker

[issue22032] Use __qualname__ together with __module__

2015-09-24 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm not expecting a change either, I was also just documenting observed breakages. Given that I've ported a *ton* of code to 3.5 and only seen a handful of failures related to this issue, I agree that it's better just to provide information and let packages

[issue25210] Special-case NoneType() in do_richcompare()

2015-09-24 Thread R. David Murray
R. David Murray added the comment: Serhiy: it's not the same, but the both are correct and parallel, and int < NoneType is *consistent* with the rest of the message, whereas having the parenthesis in there is not (since in that case you are referring to instances, not types). Changing the

Re: Python, convert an integer into an index?

2015-09-24 Thread paul.hermeneutic
Good idea. >>> [int(x) for x in str(results)] [1, 2, 3] -- https://mail.python.org/mailman/listinfo/python-list

[issue25227] Optimize ASCII/latin1 encoder with surrogateescape error handlers

2015-09-24 Thread STINNER Victor
STINNER Victor added the comment: Updated test now with more unit tests. -- Added file: http://bugs.python.org/file40563/encode_ucs1_surrogateescape-2.patch ___ Python tracker

Re: Idiosyncratic python

2015-09-24 Thread Ian Kelly
On Thu, Sep 24, 2015 at 8:07 AM, jmp wrote: > result = getResult() > > For the later, the original weird form come from a C habit to allocate > returned structures within the caller and provide a pointer to it so the > function can fill the data in, otherwise the structure

[issue25210] Special-case NoneType() in do_richcompare()

2015-09-24 Thread STINNER Victor
STINNER Victor added the comment: Stupid email interface, it restored the the previous title. I tried to change the title to: "Fix do_richcompare() error message: remove parenthesis from type names" -- ___ Python tracker

[issue25210] Special-case NoneType() in do_richcompare()

2015-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It makes the error message just non-relevant (or misleading) to the error. It refers to int < NoneType, but actually the exception is raised when you compare an int instance with a NoneType instance, not two types theirself. Comparing *any two types* raises

[issue25198] Idle: improve idle.html help viewer.

2015-09-24 Thread Mark Roseman
Mark Roseman added the comment: Have attached help-indent-fix.patch. Basically the parser is very fragile when it comes to combining tags, so the handling of the 'span .pre' was stomping on the indent tag. Separated out handling of character level tags (e.g. italic) from block level tags

[issue25210] Special-case NoneType() in do_richcompare()

2015-09-24 Thread R. David Murray
R. David Murray added the comment: That's why I said that making it like the other binary op messages might be better. Currently the error message says that the error is that two types were compared ("unorderable types"), which as you point is not quite accurate. It is, however, fairly

Re: Re: Installing pywin32.

2015-09-24 Thread Zachary Ware
Two notes about local etiquette: 1) Please reply to the list rather than to me directly. I only include your address in the cc: in case you aren't subscribed (which you should be, unless you're reading via the newsgroup), since I don't recognize you as a regular poster. I'll soon stop doing so.

Re: Installing pywin32.

2015-09-24 Thread Zachary Ware
On Thu, Sep 24, 2015 at 8:58 AM, wrote: > Hi Sir/Madam > > > When I try to run my python program where I am using the pywin32 module I am > getting the error as win32api module not found so how to install this module > please let me know ASP. Have you already installed or

[issue25225] Idle doc: redo Syntax Colors section

2015-09-24 Thread Mark Roseman
Mark Roseman added the comment: I'd suggest that there is no reason to include the list of what elements can be coloured, as it's there in the dialog for anyone who wants to muck with it. Just the first paragraph (two sentences) would be sufficient I think. Even dropping it from the document

Re: Python, convert an integer into an index?

2015-09-24 Thread Lorenzo Sutton
On 23/09/2015 17:32, Denis McMahon wrote: On Tue, 22 Sep 2015 14:43:55 -0700, Chris Roberts wrote: results = 134523 #(Integer) This appears to be an integer expressed (presumably) in base 10 with 6 digits Desired: results = [1, 2, 3, 4, 5, 2, 3] #(INDEX) This appears to be a

[issue25223] Statically or dynamically linked to the VC++runtime ? or how Python install fails on Vista despite the VC redist packages - api-ms-win-crt-runtime-l1-1-0.dll

2015-09-24 Thread eryksun
eryksun added the comment: Try directly installing the Universal CRT update, [Windows6.0-KB2999226-x86.msu][1]. Run it with the /log option, e.g. Windows6.0-KB2999226-x86.msu /log:kb2999226.evtx You can view this log in the Windows event viewer, or convert it to text XML on the command

Re: Idiosyncratic python

2015-09-24 Thread Laurent Pointal
wxjmfa...@gmail.com wrote: > Le jeudi 24 septembre 2015 08:02:38 UTC+2, Steven D'Aprano a écrit : >> >> >> What are your favorite not-wrong-just-weird Python moments? >> >> > Showing how to make Python 3.5.0 crash by > just using an "é", U+00E9. Like this ? Python 3.5.0 (default, Sep 24

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-24 Thread John Gordon
In <7ad8941d-04aa-42c5-82e9-10cdf02ab...@googlegroups.com> codyw...@gmail.com writes: > I seem to be having a problem understanding how arguments and parameters > work, Most likely why my code will not run. Can anyone elaborate on what > I am doing wrong? > def get_input(kilo): >kilo =

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-24 Thread MRAB
On 2015-09-24 19:45, codyw...@gmail.com wrote: I seem to be having a problem understanding how arguments and parameters work, Most likely why my code will not run. Can anyone elaborate on what I am doing wrong? ''' Cody Cox 9/16/2015 Programming Exercise 1 - Kilometer Converter Design a

Learning Modules, Arguments, Parameters (imma noob)

2015-09-24 Thread codywcox
I seem to be having a problem understanding how arguments and parameters work, Most likely why my code will not run. Can anyone elaborate on what I am doing wrong? ''' Cody Cox 9/16/2015 Programming Exercise 1 - Kilometer Converter Design a modular program that asks the user to enter a distance

[issue18787] Misleading error from getspnam function of spwd module

2015-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: As far as this change breaks compatibility. please add a note in the "Porting to Python 3.6" section in What's New. -- ___ Python tracker

Re: Idiosyncratic python

2015-09-24 Thread jmp
On 09/24/2015 04:26 PM, Ian Kelly wrote: On Thu, Sep 24, 2015 at 8:07 AM, jmp wrote: result = getResult() For the later, the original weird form come from a C habit to allocate returned structures within the caller and provide a pointer to it so the function can fill

[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-24 Thread Bernie Hackett
Bernie Hackett added the comment: Here's a chunk of the call stack from the Visual Studio debugger using the debug build. Py_FatalError seems to be called multiple times: > ucrtbased.dll!72d27f30()Unknown [Frames below may be incorrect and/or missing, no symbols loaded for

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-24 Thread Joel Goldstick
On Thu, Sep 24, 2015 at 2:45 PM, wrote: > I seem to be having a problem understanding how arguments and parameters > work, Most likely why my code will not run. > Can anyone elaborate on what I am doing wrong? > > ''' > Cody Cox > 9/16/2015 > Programming Exercise 1 -

[issue25154] Drop the pyvenv script

2015-09-24 Thread Remi Pointel
Remi Pointel added the comment: I would prefer to keep this script with the version referring to the version of python used (pyvenv-3.4, pyvenv-3.5, ...). -- nosy: +rpointel ___ Python tracker

Re: Idiosyncratic python

2015-09-24 Thread Mark Lawrence
On 24/09/2015 18:50, Laurent Pointal wrote: wxjmfa...@gmail.com wrote: Le jeudi 24 septembre 2015 08:02:38 UTC+2, Steven D'Aprano a écrit : What are your favorite not-wrong-just-weird Python moments? Showing how to make Python 3.5.0 crash by just using an "é", U+00E9. Would you like to

Re: Idiosyncratic python

2015-09-24 Thread Ian Kelly
On Thu, Sep 24, 2015 at 12:04 PM, jmp wrote: > I'm not an expert but I think this "return by value thing" is only for C++. > In vintage C, you can only return something that fits within a register. If that was true at one time, it was before ANSI C. $ cat test.c #include

Modifying signature of ctor in class

2015-09-24 Thread Joseph L. Casale
I have a class factory where I dynamically add a constructor to the class output. The method is a closure and works just fine, however to accommodate the varied input its signature is (*args, **kwargs). While I modify the doc strings, the ctor sig is not optimal. Without building this a string

Re: Idiosyncratic python

2015-09-24 Thread Ned Batchelder
On Thursday, September 24, 2015 at 2:02:38 AM UTC-4, Steven D'Aprano wrote: > What are your favorite not-wrong-just-weird Python moments? I've seen this a number of times: dict_of_values.update({'key': some_value}) why not: dict_of_values['key'] = some_value I've considered writing a

Re: Idiosyncratic python

2015-09-24 Thread Laura Creighton
In a message of Thu, 24 Sep 2015 13:46:27 -0700, Ned Batchelder writes: >On Thursday, September 24, 2015 at 2:02:38 AM UTC-4, Steven D'Aprano wrote: >> What are your favorite not-wrong-just-weird Python moments? > >I've seen this a number of times: > >dict_of_values.update({'key': some_value})

[issue25229] distutils doesn't add "-Wl, " prefix to "-R" on Linux if the C compiler isn't named 'gcc'

2015-09-24 Thread Calvin Walton
Changes by Calvin Walton : Added file: http://bugs.python.org/file40569/distutils-compiler-name.patch ___ Python tracker ___

Re: Modifying signature of ctor in class

2015-09-24 Thread Chris Angelico
On Fri, Sep 25, 2015 at 8:19 AM, Ian Kelly wrote: > Quick and dirty example: > > py> from inspect import Signature, Parameter > py> def foo(*args, **kwargs): pass > ... > py> foo.__signature__ = Signature([Parameter('x', > Parameter.POSITIONAL_OR_KEYWORD), Parameter('y', >

[issue9566] Compilation warnings under x64 Windows

2015-09-24 Thread Mark Lawrence
Mark Lawrence added the comment: I've got the latest output with all of the warnings but I'm not sure where I should attach it as #18295 and #18407 also apply. There are also multiple deprecation warnings but I'm sure they've been discussed before. Can somebody please advise, thanks.

Re: Learning Modules, Arguments, Parameters (imma noob)

2015-09-24 Thread Larry Hudson via Python-list
On 09/24/2015 11:45 AM, codyw...@gmail.com wrote: I seem to be having a problem understanding how arguments and parameters work, Most likely why my code will not run. Can anyone elaborate on what I am doing wrong? ''' Cody Cox 9/16/2015 Programming Exercise 1 - Kilometer Converter Design a

Re: Modifying signature of ctor in class

2015-09-24 Thread Joseph L. Casale
> You can use the FunctionType class found in the types module (and its > friends) to create functions on the run. > And you can use the 'inspect' module to inspect existing functions, if you > need to base the new function on an existing one. Hi Gal, Seems the types module docs do not even

[issue24820] IDLE themes for light on dark

2015-09-24 Thread Mark Roseman
Mark Roseman added the comment: I wrote a short utility that parses TextMate XML-based theme files (which are also used by Sublime) and converts them into something IDLE can use. It's not a perfect match, because IDLE's themes are more restrictive, but it's not bad. I'm attaching the output

[issue21506] Windows MSI installer should mklink (symlink) python.exe to python2.7.exe

2015-09-24 Thread Mark Lawrence
Mark Lawrence added the comment: I've changed the version to 3.6 only as I just can't see this happening for any other. For all I know this might have been sorted in 3.5, I'll leave that decision to our Windows gurus. -- nosy: +BreamoreBoy versions: +Python 3.6 -Python 2.7, Python

Re: Modifying signature of ctor in class

2015-09-24 Thread Joseph L. Casale
> I don't think you can easily change the function's own definition, > other than by using eval (or equivalent shenanigans, like crafting > your own bytecode); but as of Python 3.something, the help() function > looks for a __wrapped__ attribute and will take function args from > that instead of

[issue25229] distutils doesn't add "-Wl, " prefix to "-R" on Linux if the C compiler isn't named 'gcc'

2015-09-24 Thread Calvin Walton
Changes by Calvin Walton : -- keywords: +patch Added file: http://bugs.python.org/file40568/distutils-compiler-name.patch ___ Python tracker

[issue4918] Windows installer created with Python X.Y does not work with Python X.Y+1

2015-09-24 Thread Mark Lawrence
Mark Lawrence added the comment: Can this be closed as history with so many changes having been made to the installer for 3.5? -- nosy: +BreamoreBoy, paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.6 -Python 2.7, Python 3.4 ___

[issue25198] Idle: improve idle.html help viewer.

2015-09-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8b3dc527a62c by Terry Jan Reedy in branch '2.7': Issue #25198: In Idle doc viewer, fix indent of fixed-pitch text https://hg.python.org/cpython/rev/8b3dc527a62c New changeset 1d0f4b94066b by Terry Jan Reedy in branch '3.4': Issue #25198: In Idle

[issue25230] Unix datagram sockets not supported

2015-09-24 Thread Guido van Rossum
Guido van Rossum added the comment: The simplest fix for this IMO is to add a sock parameter to create_datagram_endpoint(). I've filed an issue for this in the upstream asyncio project: https://github.com/python/asyncio/issues/266 -- ___ Python

[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2015-09-24 Thread Bernie Hackett
Bernie Hackett added the comment: On second thought, _Py_CheckRecursiveCall may be being called recursively through Py_FatalError. -- ___ Python tracker

[issue25198] Idle: improve idle.html help viewer.

2015-09-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: Fixed. I added a light background as with Sphinx html. I am delighted with how well this is working so far. I like the little always-there [TOC] button better than the browser sidebar. Besides making it easy to verify the look of doc changes, I think it

  1   2   >