Re: import in code

2018-07-22 Thread Mark Lawrence
On 22/07/18 05:45, Cameron Simpson wrote: On 22Jul2018 06:43, Abdur-Rahmaan Janhangeer wrote: i have found some reputable books that include import within code with ...    import x if ...    import y def ...     import z according to me they should be placed at the top. but an advantage of

Re: pattern block expression matching

2018-07-22 Thread aldi . kraja
Thank you all for thoughtful excellent updates! Aldi -- https://mail.python.org/mailman/listinfo/python-list

Re: send PIL.Image to django server side and get it back

2018-07-22 Thread iMath
Thanks, I solved it finally stackoverflow.com/a/51453785/1485853 -- https://mail.python.org/mailman/listinfo/python-list

Re: For next loops

2018-07-22 Thread no
never mind. x = range (5) y = range (5) for ply in x: for com in y: if ply==com: result="Tie" print(ply,com,result) result = "" On Sun, 22 Jul 2018 23:17:24 -0400, no@none.invalid wrote: >x = range (5) >y = range (5) >for ply in x: >for com in y: >

Re: [RELEASED] Python 3.4.9rc1 and Python 3.5.6rc1 are now available

2018-07-22 Thread Rustom Mody
On Friday, July 20, 2018 at 7:51:22 AM UTC+5:30, Larry Hastings wrote: … > the availability of Python 3.4.9rc1 and Python 3.5.6rc1. > Python's entrenched bureaucracy soldiers on, > //arry/  And ² at 325 posts of customary inanity at the recent events but nary a squeak of regret --

Re: PyCharm

2018-07-22 Thread no
On Fri, 20 Jul 2018 20:56:41 -0700, Michael Vilain wrote: >I'm running PyCharm Edu (to go through their great tutorial). It's version is >2018.1.3, which I got from the web site. Unless you mistyped the version, >this is the current release and yours is very old. The date was just from a

[issue940286] pydoc.Helper.help() ignores input/output init parameters

2018-07-22 Thread miss-islington
Change by miss-islington : -- pull_requests: +7928 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

Re: Non-GUI, single processort inter process massaging - how?

2018-07-22 Thread Jan Claeys
On Sat, 2018-07-21 at 11:50 -0400, Dennis Lee Bieber wrote: > Each client would use the urllib (various names between v2 > and v3) to submit requests to the server, and process the returned > "page". Or the client could even be a bash script using curl, or any other HTTP client... --

[issue940286] pydoc.Helper.help() ignores input/output init parameters

2018-07-22 Thread miss-islington
Change by miss-islington : -- pull_requests: +7929 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue940286] pydoc.Helper.help() ignores input/output init parameters

2018-07-22 Thread Berker Peksag
Berker Peksag added the comment: New changeset d04f46c59f1d07d9bcc0ba910741296ac88d370d by Berker Peksag in branch 'master': bpo-940286: Fix pydoc to show cross refs correctly (GH-8390) https://github.com/python/cpython/commit/d04f46c59f1d07d9bcc0ba910741296ac88d370d --

[issue21446] Update reload fixer to use importlib instead of imp

2018-07-22 Thread Berker Peksag
Change by Berker Peksag : -- versions: +Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29336] merge tuples in module

2018-07-22 Thread INADA Naoki
Change by INADA Naoki : -- resolution: postponed -> duplicate stage: -> resolved status: pending -> closed superseder: -> Same constants in tuples are not merged while compile() ___ Python tracker

[issue34192] FunctionType.__new__ can generate functions that immediately crash

2018-07-22 Thread Dan Snider
New submission from Dan Snider : The following program crashes on 3.3.1, 3.4.2, 3.5.2, and 3.6.1 because despite having a non-empty co_cellvars slot due to the generator object, the NOFREE flag was set. 3.7 isn't immune to some bad behavior here, either. While I only have access to 3.7.03b

Re: ongoing browser projects

2018-07-22 Thread Abdur-Rahmaan Janhangeer
*Have you looked on PyPI?* that's the problem. due to the lack of py support html renderer just gives text-based html renderings there are also qt5 based ones but qt more of an off py project ported to py. if really needed, that i think it's the option i've also viewed C-based ones with python

[issue940286] pydoc.Helper.help() ignores input/output init parameters

2018-07-22 Thread Éric Araujo
Éric Araujo added the comment: Patch works! -- assignee: eric.araujo -> berker.peksag ___ Python tracker ___ ___ Python-bugs-list

Re: ongoing browser projects

2018-07-22 Thread Chris Angelico
On Mon, Jul 23, 2018 at 11:43 AM, Akkana Peck wrote: >> On 22/07/18 21:43, Abdur-Rahmaan Janhangeer wrote: >> > i need an html renderer (one of the most badly missed features of py, PEP >> > anyone?) > > I think both GTK and Qt have basic HTML rendering widgets, for > simple tasks, but if you

[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2018-07-22 Thread mattip
mattip added the comment: It would be sufficient to modify the documentation to reflect the code. There are other objects like `file` that recommend[0] calling a method to release resources without depending on implementation-specific details like garbage collection. [0]

Re: ongoing browser projects

2018-07-22 Thread Akkana Peck
> On 22/07/18 21:43, Abdur-Rahmaan Janhangeer wrote: > > i need an html renderer (one of the most badly missed features of py, PEP > > anyone?) I think both GTK and Qt have basic HTML rendering widgets, for simple tasks, but if you want something that behaves more like a browser (javascript, link

[issue31734] crash or SystemError in sqlite3.Cache in case it is uninitialized or partially initialized

2018-07-22 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the PR and for the work you've been doing to fix similar bugs in Python! The Cache class is an implementation detail and it has no practical use for third party users. See issue 30262 for a discussion on making it private. If a user somehow finds

PEP 572 implementation for Python

2018-07-22 Thread Andy Valencia
Hi, just an FYI (and request for comments). I've coded up PEP 572 on top of "Tauthon" (sometimes in early days known as "Python 2.8"): https://github.com/vandys/tauthon (branch pep572) After reading the PEP, Guido's comments, and looking at the code, I realized that := just wants to be an

Re: coding style - where to declare variables

2018-07-22 Thread Steven D'Aprano
On Sun, 22 Jul 2018 17:50:06 -0400, Dennis Lee Bieber wrote: > On Mon, 23 Jul 2018 00:08:00 +0300, Marko Rauhamaa > declaimed the following: > >>I Java terms, all Python values are boxed. That's a very usual pattern >>in virtually all programming languages (apart from FORTRAN). >> >> >

Re: coding style - where to declare variables

2018-07-22 Thread Steven D'Aprano
On Mon, 23 Jul 2018 00:08:00 +0300, Marko Rauhamaa wrote: > Would you call it binding in this case: > >X[0]["z"] = getit() >X[3]["q"] = X[0]["z"] >X[0]["z"].changeit() It is a binding, but it is not a *name* binding. Since we are talking about name bindings, and

Re: coding style - where to declare variables

2018-07-22 Thread Steven D'Aprano
On Sun, 22 Jul 2018 22:50:52 +0300, Marko Rauhamaa wrote: > I wish people stopped talking about "name binding" and "rebinding," > which are simply posh synonyms for variable assignment. Properly, the > term "binding" comes from lambda calculus, whose semantics is defined > using "bound" and

Re: ongoing browser projects

2018-07-22 Thread Thomas Jollans
On 22/07/18 21:43, Abdur-Rahmaan Janhangeer wrote: > apart from grail, any ongoing browser projects? > > i need an html renderer (one of the most badly missed features of py, PEP > anyone?) Nobody writes browser engines. It's too hard to do what the available open source ones do half as well as

[issue34188] Allow dict choices to "transform" values in argpagse

2018-07-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Victor, please don't try to get your way by adopting a tone of shoving people around or mis-parsing their words try to catch them in a contradiction. There is in fact a boundary between argument parsing logic and application logic. In my view, the

[issue34136] Del on class __annotations__ regressed, failing test

2018-07-22 Thread Guido van Rossum
Guido van Rossum added the comment: > Did you consider my suggestion to make it a "SyntaxError" for > "del __annotations__" on a class level or even module level or at all? > Or does this go too far? That's not reasonable. __annotations__ is just an identifier. There are lots of other things

[issue34188] Allow dict choices to "transform" values in argpagse

2018-07-22 Thread Victor Porton
Victor Porton added the comment: @Raymond: "Downstream processing or transformation of inputs is beyond the scope of argparse which should stick to its core responsibilities of argument extraction." You somehow contradict the official documentation: "One particularly effective way of

Re: coding style - where to declare variables

2018-07-22 Thread Marko Rauhamaa
Richard Damon : >> On Jul 22, 2018, at 3:50 PM, Marko Rauhamaa wrote: >> I wish people stopped talking about "name binding" and "rebinding," >> which are simply posh synonyms for variable assignment. Properly, the >> term "binding" comes from lambda calculus, whose semantics is defined >> using

Re: coding style - where to declare variables

2018-07-22 Thread Chris Angelico
On Mon, Jul 23, 2018 at 6:14 AM, Marko Rauhamaa wrote: > While FORTRAN or C couldn't operate on functions like this, an assembly > language program could easily. Simply compose a CPU instruction sequence > on the fly, mark it executable and use the "CALL" opcode to transfer > control to your

[issue34188] Allow dict choices to "transform" values in argpagse

2018-07-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Zachary. Downstream processing or transformation of inputs is beyond the scope of argparse which should stick to its core responsibilities of argument extraction. -- assignee: -> bethard nosy: +bethard, rhettinger type: behavior

Re: coding style - where to declare variables

2018-07-22 Thread Marko Rauhamaa
Bart : > If you did need one of those others to be variable, then you just assign > it to a variable the rare times you need to do that. For example: > > def fn1(): pass > def fn2(): pass > > fn = fn1 if cond else fn2 > > fn1, fn2 will always be functions. fn will always be a variable, but

Re: coding style - where to declare variables

2018-07-22 Thread Richard Damon
> On Jul 22, 2018, at 3:50 PM, Marko Rauhamaa wrote: > I wish people stopped talking about "name binding" and "rebinding," > which are simply posh synonyms for variable assignment. Properly, the > term "binding" comes from lambda calculus, whose semantics is defined > using "bound" and "free"

[issue34127] Gramatically incorrect error message for some calls with wrong number of arguments

2018-07-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Nice work. Thanks for the patch. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue34127] Gramatically incorrect error message for some calls with wrong number of arguments

2018-07-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 1426daa4fe47d8f8be0d416f7cba7adae1d5839f by Raymond Hettinger (Xtreak) in branch 'master': bpo-34127: Fix grammar in error message with respect to argument count (GH-8395)

Re: ongoing browser projects

2018-07-22 Thread Chris Angelico
On Mon, Jul 23, 2018 at 5:43 AM, Abdur-Rahmaan Janhangeer wrote: > apart from grail, any ongoing browser projects? > > i need an html renderer (one of the most badly missed features of py, PEP > anyone?) Have you looked on PyPI? https://pypi.org/ ChrisA --

Re: functions vs methods

2018-07-22 Thread Chris Angelico
On Mon, Jul 23, 2018 at 1:49 AM, MRAB wrote: > On 2018-07-22 10:08, Ben Finney wrote: >> >> INADA Naoki writes: >> >>> Please don't refer the FAQ entry. >>> See this: https://bugs.python.org/issue27671 >> >> >> Interesting. Thanks for raising that bug report. >> >> I offer my text as a starting

[issue34191] argparse: Missing subparser error message should be more clear

2018-07-22 Thread Victor Porton
New submission from Victor Porton : argparse produces a long unreadable, non-understandable for non-programmers error message when a subparser is not specified in the command line. Note that the below message contains Ubuntu specifics, but it seems it would be nearly as unclear on other OSes

Re: coding style - where to declare variables

2018-07-22 Thread Marko Rauhamaa
r...@zedat.fu-berlin.de (Stefan Ram): >>Rebinding names is near-universal in programming, but usually names >>that are intended to be rebound, such as variables. > > To someone like me who has grown up with a LISP 1 > this is completely natural. > > |>( SETQ A ( LAMBDA () 'ALPHA )) > |(LAMBDA

ongoing browser projects

2018-07-22 Thread Abdur-Rahmaan Janhangeer
apart from grail, any ongoing browser projects? i need an html renderer (one of the most badly missed features of py, PEP anyone?) thanks, Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauritius -- https://mail.python.org/mailman/listinfo/python-list

[issue34190] x86 Gentoo Refleaks 3.x: test_sys_setprofile leaked [1, 1, 1] references, sum=3

2018-07-22 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Same error in the x86 Gentoo Refleaks 3.7 buildbot: https://buildbot.python.org/all/#/builders/114/builds/174 -- ___ Python tracker

[issue34190] x86 Gentoo Refleaks 3.x: test_sys_setprofile leaked [1, 1, 1] references, sum=3

2018-07-22 Thread Pablo Galindo Salgado
New submission from Pablo Galindo Salgado : The x86 Gentoo Refleaks 3.x report that test_sys_setprofile is potentially leaking referenecs: https://buildbot.python.org/all/#/builders/1/builds/292 -- Ran 21 tests in 0.007s OK

[issue34021] [2.7] test_regrtest: test_env_changed() fails on x86 Windows XP VS9.0 2.7

2018-07-22 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: It seems that this buildbot failure is related to this issue: https://buildbot.python.org/all/#/builders/105/builds/192 1 test failed: test_regrtest 43 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd

[issue34189] Add simple tests for new Tk widget options

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

[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 46cb5fd706563673663e676bb70f46a73f4edc89 by Serhiy Storchaka in branch '2.7': [2.7] bpo-34189: Add simple tests for new Tk widget options. (GH-8396). (GH-8400) https://github.com/python/cpython/commit/46cb5fd706563673663e676bb70f46a73f4edc89

[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 0ff174643437f34c50c8625462b5419b1a643b57 by Serhiy Storchaka in branch '3.6': [3.6] bpo-34189: Add simple tests for new Tk widget options. (GH-8396) (GH-8399) https://github.com/python/cpython/commit/0ff174643437f34c50c8625462b5419b1a643b57

[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset c7b91d95d8890a4bafefa797f194a1ae3f0f0abb by Serhiy Storchaka in branch '3.7': [3.7] bpo-34189: Add simple tests for new Tk widget options. (GH-8396) (GH-8398) https://github.com/python/cpython/commit/c7b91d95d8890a4bafefa797f194a1ae3f0f0abb

[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +7926 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +7927 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +7925 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset c75c1e0e8aeb720ac3fcfab119b70cabba4e8235 by Serhiy Storchaka in branch 'master': bpo-34189: Fix checking for bugfix Tcl version. (GH-8397) https://github.com/python/cpython/commit/c75c1e0e8aeb720ac3fcfab119b70cabba4e8235 --

[issue34180] bool(Q) always return True for a priority queue Q

2018-07-22 Thread Tim Peters
Tim Peters added the comment: I'm sure Guido designed the API to discourage subtly bug-ridden code relying on the mistaken belief that it _can_ know the queue's current size. In the general multi-threaded context Queue is intended to be used, the only thing `.qsize()`'s caller can know is

[issue34127] Gramatically incorrect error message for some calls with wrong number of arguments

2018-07-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: We don't normally backport an exception message change unless its content, as opposed to style, is erroneous. -- type: -> enhancement versions: -Python 3.6, Python 3.7 ___ Python tracker

[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +7924 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

Re: PyCharm

2018-07-22 Thread no
On Sun, 22 Jul 2018 11:51:51 +0200, Chris Warrick wrote: >On Sat, 21 Jul 2018 at 05:17, wrote: >> >> Win7 >> >> I was watching some tutorial videos on Python that recommended I use >> PyCharm and it worked pretty well until I tried to use input. >> >> I found this: >>

[issue34188] Allow dict choices to "transform" values in argpagse

2018-07-22 Thread ppperry
Change by ppperry : -- title: Use dicts to "transform" argparse arguments to values -> Allow dict choices to "transform" values in argpagse ___ Python tracker ___

[issue25943] Integer overflow in _bsddb leads to heap corruption

2018-07-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 041a4ee9456d716dd449d38a5328b82e76f5dbc4 by Serhiy Storchaka (Zackery Spytz) in branch '2.7': bpo-25943: Check for integer overflow in bsddb's DB_join(). (GH-8392)

[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset e271ca78e37a502b3dc1036f824aa3999efcd56b by Serhiy Storchaka in branch 'master': bpo-34189: Add simple tests for new Tk widget options. (GH-8396) https://github.com/python/cpython/commit/e271ca78e37a502b3dc1036f824aa3999efcd56b --

[issue34154] Tkinter __init__ documentations sometimes missing valid keyword values

2018-07-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Few new options were added: see issue34189. -- ___ Python tracker ___ ___ Python-bugs-list

[issue21446] Update reload fixer to use importlib instead of imp

2018-07-22 Thread Brett Cannon
Brett Cannon added the comment: I think we said backporting fixers was fine but I honestly don't remember. On Sat, Jul 21, 2018, 23:22 Berker Peksag, wrote: > > Berker Peksag added the comment: > > Thanks, Brett. I've opened PR 8391. Should we backport this to 3.7? We do > backport

[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +7923 stage: -> patch review ___ Python tracker ___ ___

[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2018-07-22 Thread Windson Yang
Windson Yang added the comment: Add a __del__ method in the Pool class should work. But I'm not sure we should do this. -- ___ Python tracker ___

[issue34189] Add simple tests for new Tk widget options

2018-07-22 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The following PR adds simple tests for Tk widget options added in Tk 8.6.5. TIP 441: Add -justify Configuration Option to the listbox Widget https://core.tcl.tk/tips/doc/trunk/tip/441.md TIP 437: Tk panedwindow options for proxy window

[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2018-07-22 Thread Windson Yang
Change by Windson Yang : -- nosy: +zach.ware ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33187] Document ElementInclude (XInclude) support in ElementTree

2018-07-22 Thread Anjali Bansal
Anjali Bansal added the comment: Thank you for the information. I had started working on this issue. You can assign it to me if needed. I will create a PR soon. Github Username: bansalanjali2512 -- ___ Python tracker

Re: functions vs methods

2018-07-22 Thread MRAB
On 2018-07-22 10:08, Ben Finney wrote: INADA Naoki writes: Please don't refer the FAQ entry. See this: https://bugs.python.org/issue27671 Interesting. Thanks for raising that bug report. I offer my text as a starting point for a better explanation: Because ‘len’ works with *any*

Re: list of lists

2018-07-22 Thread Thomas Jollans
On 22/07/18 14:53, Sharan Basappa wrote: > Thanks. I initially thought about this but did not know if this is legal > syntax. In this kind of situation – you think you know how to do something but you're not quite sure if it'll work as intended – just try it! Start up an interactive interpreter,

Re: coding style - where to declare variables

2018-07-22 Thread Peter J. Holzer
On 2018-07-22 09:36:13 -0400, Richard Damon wrote: > > On Jul 22, 2018, at 8:48 AM, Sharan Basappa > > wrote: > > > > In other programming languages (e.g. C, C++), as a good practice, > > variables are declared right at the start of the program, There is no "start of the program" in C or C++.

[issue34172] multiprocessing.Pool and ThreadPool leak resources after being deleted

2018-07-22 Thread tzickel
tzickel added the comment: But alas that does not work... -- nosy: +davin, pitrou ___ Python tracker ___ ___ Python-bugs-list

[issue34127] Gramatically incorrect error message for some calls with wrong number of arguments

2018-07-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I have added a simple patch based on the changes by https://bugs.python.org/issue29951. The C code related error messages doesn't seem to have been covered by tests and I have added some tests. I have limited knowledge of C and this is my first C

[issue34127] Gramatically incorrect error message for some calls with wrong number of arguments

2018-07-22 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- keywords: +patch pull_requests: +7922 stage: needs patch -> patch review ___ Python tracker ___

[issue20906] Issues in Unicode HOWTO

2018-07-22 Thread A.M. Kuchling
Change by A.M. Kuchling : -- keywords: +patch pull_requests: +7921 stage: needs patch -> patch review ___ Python tracker ___ ___

[issue34186] [3.6.6 on macOS] os.listdir replacing "/" with ":"

2018-07-22 Thread Todd
Todd added the comment: Ah, thank you for the link. I looked for something like that, but I obviously didn’t use the right wording while searching. Sorry for the false report and thanks for the quick help. -Todd Sent from my iPhone > On Jul 21, 2018, at 10:10 PM, Zachary Ware wrote: > >

Re: coding style - where to declare variables

2018-07-22 Thread Abdur-Rahmaan Janhangeer
except local vars Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauritius -- https://mail.python.org/mailman/listinfo/python-list

Re: coding style - where to declare variables

2018-07-22 Thread Chris Angelico
On Sun, Jul 22, 2018 at 10:48 PM, Sharan Basappa wrote: > In other programming languages (e.g. C, C++), as a good practice, variables > are declared right at the start of the program, irrespective of where it is > normally used. What is the practice in Python? > > I see that, most of the code,

Re: coding style - where to declare variables

2018-07-22 Thread Richard Damon
> On Jul 22, 2018, at 8:48 AM, Sharan Basappa wrote: > > In other programming languages (e.g. C, C++), as a good practice, variables > are declared right at the start of the program, irrespective of where it is > normally used. What is the practice in Python? > > I see that, most of the

[issue34188] Use dicts to "transform" argparse arguments to values

2018-07-22 Thread Zachary Ware
Zachary Ware added the comment: I like to think I'm fairly reasonable :). You can get what you want by specifying `type=choices_dict.get`, or by extracting from the dict manually after calling `parse_args`. -- nosy: +zach.ware ___ Python tracker

Re: list of lists

2018-07-22 Thread Sharan Basappa
On Sunday, 22 July 2018 18:34:41 UTC+5:30, Iwo Herka wrote: > > Can you tell me how this works? > > "results[0]" returns a list with two elements. Let's call it "pair" > > pair = results[0] > # ['1', 0.99921393753233001] > > Now, we can use regular sequence unpacking to retrieve first

Error installing scripts in python 37-32

2018-07-22 Thread ojas gupta
Explaining the whole scenario in detail : I open command prompt and go to C: then I enter "pip install mysqlclient" (Double inverted commas is just for highlights .) After pressing enter key it installs some data and after a while an error comes up saying "import setuptools, tokensize;_file_="

Re: list of lists

2018-07-22 Thread Iwo Herka
> Can you tell me how this works? "results[0]" returns a list with two elements. Let's call it "pair" pair = results[0] # ['1', 0.99921393753233001] Now, we can use regular sequence unpacking to retrieve first and second argument: a, b = pair which is equivalent to this:

[issue25943] Integer overflow in _bsddb leads to heap corruption

2018-07-22 Thread Zackery Spytz
Change by Zackery Spytz : -- pull_requests: +7920 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25943] Integer overflow in _bsddb leads to heap corruption

2018-07-22 Thread Zackery Spytz
Zackery Spytz added the comment: Integer overflow can also occur in DB_join(). -- ___ Python tracker ___ ___ Python-bugs-list

Re: list of lists

2018-07-22 Thread Sharan Basappa
On Sunday, 22 July 2018 18:15:23 UTC+5:30, Frank Millman wrote: > "Sharan Basappa" wrote in message > news:8e261f75-03f7-4f80-a516-8318dd138...@googlegroups.com... > > > > I am using a third party module that is returning list of lists. > > I am using the example below to illustrate. > > > > 1

[issue34188] Use dicts to "transform" argparse arguments to values

2018-07-22 Thread Victor Porton
New submission from Victor Porton : The below code produces "rock", but it should produce "a". This (to use dict value instead of the key by argparse result) is both to be a new useful feature (for example to map strings in a command line to certain functions or classes provided as dict

[issue34188] Use dicts to "transform" argparse arguments to values

2018-07-22 Thread Victor Porton
Change by Victor Porton : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

coding style - where to declare variables

2018-07-22 Thread Sharan Basappa
In other programming languages (e.g. C, C++), as a good practice, variables are declared right at the start of the program, irrespective of where it is normally used. What is the practice in Python? I see that, most of the code, declare variables where it is used and not at the start of the

Re: list of lists

2018-07-22 Thread Frank Millman
"Sharan Basappa" wrote in message news:8e261f75-03f7-4f80-a516-8318dd138...@googlegroups.com... I am using a third party module that is returning list of lists. I am using the example below to illustrate. 1 results = [['1', 0.99921393753233001]] 2 k = results[0] 3 print k[0] 4 print k[1]

Re: list of lists

2018-07-22 Thread Sharan Basappa
Thanks. This works in my example. Can you tell me how this works? > You can simply unpack the inner list: > > a, b = results[0] > > > Iwo Herka > > ‐‐‐ Original Message ‐‐‐ > > On 22 July 2018 11:47 AM, Sharan Basappa wrote: > > > ​​ > > > > I am using a third party module

Re: list of lists

2018-07-22 Thread Iwo Herka
You can simply unpack the inner list: a, b = results[0] Iwo Herka ‐‐‐ Original Message ‐‐‐ On 22 July 2018 11:47 AM, Sharan Basappa wrote: > ​​ > > I am using a third party module that is returning list of lists. > > I am using the example below to illustrate. > > 1 results

list of lists

2018-07-22 Thread Sharan Basappa
I am using a third party module that is returning list of lists. I am using the example below to illustrate. 1 results = [['1', 0.99921393753233001]] 2 k = results[0] 3 print k[0] 4 print k[1] Assume the line 1 is what is returned. I am assigning that to another list (k on line 2) and then

Re: print & string formatting

2018-07-22 Thread Sharan Basappa
On Sunday, 22 July 2018 10:24:55 UTC+5:30, Cameron Simpson wrote: > On 21Jul2018 21:33, Sharan Basappa wrote: > >I get a lot confused while using print functions in Python. > > > >For example, I get the same results for the following code: > > > >str = "one two three" > > Pleasetry not to name

[issue34166] Tools/msgfmt.py emits a DeprecationWarning under Python 3.7

2018-07-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6, Python 3.8 ___ Python tracker ___

[issue34181] Lib/test/test_typing.py failed when ran as a script

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

[issue34181] Lib/test/test_typing.py failed when ran as a script

2018-07-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 81f85d09f4cc83fc35452afcca75baaf64831b22 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.7': bpo-34181: Fix running Lib/test/test_typing.py as a script. (GH-8380) (GH-8385)

Re: Better way / regex to extract values form a dictionary

2018-07-22 Thread Thomas Jollans
On 21/07/18 14:39, Ganesh Pal wrote: >> The dictionary is irrelevant to your question. It doesn't matter whether >> the path came from a dict, a list, read directly from stdin, an >> environment variable, extracted from a CSV file, or plucked directly from >> outer space by the programmer. The

Re: PyCharm

2018-07-22 Thread Chris Warrick
On Sat, 21 Jul 2018 at 05:17, wrote: > > Win7 > > I was watching some tutorial videos on Python that recommended I use > PyCharm and it worked pretty well until I tried to use input. > > I found this: > https://youtrack.jetbrains.com/issue/PY-27891 > > It says.. > Pavel Karateev

[issue34158] Documentation of datetime '%z' format code is odd

2018-07-22 Thread Martin Panter
Martin Panter added the comment: FWIW more oddities with this paragraph could be fixed by: * removing the first “and” from “HH is . . ., [and] MM is . . ., SS is . . . and uu is”, * changing the condition for omitting “uu” from “a whole number of [minutes]” to “seconds”, and *

[issue34115] code.InteractiveConsole.interact() closes stdin

2018-07-22 Thread Eryk Sun
Eryk Sun added the comment: > On Windows Console, sys.stdin.close() does not prevent a second > interact call. This might be considered a bug. This is a bug in io._WindowsConsoleIO. In Python 3, the sys.std* file objects that get created at startup use closefd=False: >>>

Re: functions vs methods

2018-07-22 Thread Ben Finney
INADA Naoki writes: > Please don't refer the FAQ entry. > See this: https://bugs.python.org/issue27671 Interesting. Thanks for raising that bug report. I offer my text as a starting point for a better explanation: Because ‘len’ works with *any* sequence, not only lists. To implement

Re: Make, Sphinx and Windows

2018-07-22 Thread Abdur-Rahmaan Janhangeer
@ThomasJollans was supposed to detect errors in trabslation format such as the famous miss of éspace insécable etc, not conformed to sphinx notation e.g. if i put an extra space between the : and ` :meth: `some_meth` Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauritius --

[issue34187] Issues with lazy fd support in _WindowsConsoleIO fileno() and close()

2018-07-22 Thread Eryk Sun
New submission from Eryk Sun : The _WindowsConsoleIO implementation of fileno should raise a ValueError if the internal handle value is INVALID_HANDLE_VALUE. Currently it raises io.UnsupportedOperation, and only if closefd=True. >>> f = open('conin$', 'r') >>> f.close() >>>

  1   2   >