[issue26095] Update porting HOWTO to special-case Python 2 code, not Python 3

2016-01-12 Thread Nick Coghlan
Nick Coghlan added the comment: The feature detection approach is especially important for anything covered by the security backports in PEP 466 and 476, but can also apply for things like installing the importlib2 meta_path hooks into Python 2.7. -- nosy: +ncoghlan

[issue26087] PEP 0373 should be updated

2016-01-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1046a40e086f by Benjamin Peterson in branch 'default': update 2.7 schedule (closes #26087) https://hg.python.org/peps/rev/1046a40e086f -- nosy: +python-dev resolution: -> fixed stage: -> resolved status: open -> closed

Stop writing Python 4 incompatible code

2016-01-12 Thread Steven D'Aprano
Quote: With the end of support for Python 2 on the horizon (in 2020), many package developers have made their packages compatible with both Python 2 and Python 3 by using constructs such as: if sys.version_info[0] == 2: # Python 2 code else: #

Re: Data Entry

2016-01-12 Thread tdsperth
On Wednesday, January 13, 2016 at 9:52:17 AM UTC+8, tdsp...@gmail.com wrote: > Hi All > > I have written a small web app using cgi for testing for changes to data from > a python script that does a lot of database updating depending on certain > conditions > > form = cgi.FieldStorage() >

Re: When I need classes?

2016-01-12 Thread Rustom Mody
On Sunday, January 10, 2016 at 1:00:13 PM UTC+5:30, Arshpreet Singh wrote: > Hello Friends, I am quite new to OOP(object oriented Programming), I did some > projects with python which includes Data-Analysis, Flask Web Development and > some simple scripts. > > I have only one question which is

[issue24780] unittest assertEqual difference output foiled by newlines

2016-01-12 Thread anchal agarwal
anchal agarwal added the comment: There is another case where the error message displayed by self.assertEqual() is weird. == FAIL: test_newline_1 (__main__.AssertEqualTest)

[issue25752] asyncio.readline - add customizable line separator

2016-01-12 Thread Martin Panter
Martin Panter added the comment: The same Git Hub pull request is mentioned in Issue 26050, so I am guessing this is now a duplicate. -- nosy: +martin.panter resolution: wont fix -> duplicate status: open -> closed superseder: -> Add new StreamReader.readuntil() method

Re: When I need classes?

2016-01-12 Thread Rustom Mody
On Wednesday, January 13, 2016 at 10:57:23 AM UTC+5:30, Steven D'Aprano wrote: > On Wednesday 13 January 2016 14:36, Rustom Mody wrote: > > > 1. Python the LANGUAGE, is rather even-handed in paradigm choice: Choose > > OO, imperative, functional or whatever style pleases/suits you > > 2. Python

Re: When I need classes?

2016-01-12 Thread Steven D'Aprano
On Wednesday 13 January 2016 14:36, Rustom Mody wrote: > 1. Python the LANGUAGE, is rather even-handed in paradigm choice: Choose > OO, imperative, functional or whatever style pleases/suits you > 2. Python LIBRARIES however need to make committing choices. Users of > those then need to align

[issue15071] TLS get keys and randoms

2016-01-12 Thread Daniël van Eeden
Changes by Daniël van Eeden : -- nosy: +dveeden ___ Python tracker ___ ___

[issue26088] re

2016-01-12 Thread Ezio Melotti
Changes by Ezio Melotti : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___

Re: Need help on a project To :"Create a class called BankAccount with the following parameters "

2016-01-12 Thread jeff
On Friday, January 8, 2016 at 6:16:49 PM UTC+1, geral...@gmail.com wrote: > On Friday, 8 January 2016 17:38:11 UTC+1, acushl...@gmail.com wrote: > > On Wednesday, 30 December 2015 19:21:32 UTC+1, Won Chang wrote: > > > i have these task which i believe i have done well to some level > > > > > >

Re: Which Python editor has this feature?

2016-01-12 Thread Terry Reedy
On 1/11/2016 8:09 PM, Chris Angelico wrote: On Tue, Jan 12, 2016 at 11:55 AM, Bernardo Sulzbach wrote: On Mon, Jan 11, 2016 at 10:14 PM, Chris Angelico wrote: Next IDLE feature request: Can you make it so that, across all platforms, it magically

[issue19316] devguide: compiler - wording

2016-01-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 43d842419188 by Ezio Melotti in branch 'default': #19316: fix wording in the compiler.rst page. https://hg.python.org/devguide/rev/43d842419188 -- nosy: +python-dev ___ Python tracker

[issue19006] UnitTest docs should have a single list of assertions

2016-01-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset ddb8fa84a119 by Ezio Melotti in branch '2.7': #19006: fix wording in unittest docs. https://hg.python.org/cpython/rev/ddb8fa84a119 New changeset 84f34e8685de by Ezio Melotti in branch '3.5': #19006: fix wording in unittest docs.

[issue25574] 2.7 incorrectly documents objects hash as equal to id

2016-01-12 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks for the report and the patch! -- assignee: docs@python -> ezio.melotti nosy: +ezio.melotti resolution: -> fixed stage: -> resolved status: open -> closed type: -> enhancement ___ Python tracker

[issue25574] 2.7 incorrectly documents objects hash as equal to id

2016-01-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 499ee454eecc by Ezio Melotti in branch '2.7': #25574: backport glossary doc fix about hash and id of user-defined classes. https://hg.python.org/cpython/rev/499ee454eecc -- nosy: +python-dev ___ Python

[issue26068] re.compile() repr end quote truncated

2016-01-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: More smart truncating with closing quote and dots was the idea that I want to propose since introducing %R, but I didn't have time to formulate this. Opened issue26090 for this. -- ___ Python tracker

[issue26089] Duplicated keyword in distutils metadata

2016-01-12 Thread Ezio Melotti
Ezio Melotti added the comment: This seems to be because the alternative spelling "licence" was also included in the list, and got changed in #693470/178d19cff163. Because of that change, the method get_licence() is not supported anymore, but at this point removing the duplicate "license"

[issue26090] More correct string truncating in PyUnicode_FromFormat()

2016-01-12 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti stage: -> needs patch ___ Python tracker ___

[issue26088] re

2016-01-12 Thread Hana Larsen
New submission from Hana Larsen: -- Hans Larsen Galgebakken Sønder 4-11A 2620 Albertslund Danmark/Danio -- messages: 258073 nosy: Johano priority: normal severity: normal status: open title: re ___ Python tracker

[issue25940] SSL tests failed due to expired svn.python.org SSL certificate

2016-01-12 Thread Martin Panter
Martin Panter added the comment: Here is the corresponding patch for the test suite. This version should fix all the SSL tests as long as the server is updated. -- Added file: http://bugs.python.org/file41590/use-pythontest.v2.patch ___ Python

Re: I'm missing something here...

2016-01-12 Thread Erik
Apologies for self-replying On 12/01/16 08:24, Erik wrote: On 12/01/16 07:13, Cameron Simpson wrote: The former. Almost any loop _might_ be executed zero times. Compilers and linters etc should only complain if they can prove the loop is always executed zero times. I was just raising the

[issue26001] Tutorial: write() does not expect string in binary mode

2016-01-12 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks Dimistri for the report, Upendra for the patch, Terry for the review, and Elena for the rewrapping! I also rephrased the last sentence a bit to make it more readable. -- assignee: docs@python -> ezio.melotti nosy: +ezio.melotti resolution:

[issue26089] Duplicated keyword in distutils metadata

2016-01-12 Thread Augustin Laville
New submission from Augustin Laville: The line https://hg.python.org/cpython/file/tip/Lib/distutils/dist.py#l1016 contains the word "licence" twice. Check only on Python, 3.5 and 3.6, may be in others versions. -- components: Distutils messages: 258091 nosy: Augustin Laville, dstufft,

Re: python

2016-01-12 Thread Jianling Fan
It seems like that python was already installed in your computer. Please check . On 11 January 2016 at 14:45, Sean Melville wrote: > I don't believe it's xp, it's a new laptop > > > >> On 11 Jan 2016, at 20:33, Cameron Simpson wrote: >> >>> On

[issue19316] devguide: compiler - wording

2016-01-12 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks everyone for the patches and the reviews! -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue24712] Docs page's sidebar vibrates on mouse wheel scroll on Chrome.

2016-01-12 Thread Ezio Melotti
Ezio Melotti added the comment: CSS: Doc/tools/pydoctheme/static/pydoctheme.css JS: Doc/tools/static/sidebar.js The repo is https://hg.python.org/cpython/, but there should be a github mirror too. See also the devguide for more info. -- ___ Python

[issue26087] PEP 0373 should be updated

2016-01-12 Thread Georg Brandl
Changes by Georg Brandl : -- assignee: docs@python -> benjamin.peterson nosy: +benjamin.peterson ___ Python tracker ___

[issue24918] Docs layout bug

2016-01-12 Thread Georg Brandl
Georg Brandl added the comment: If it works... -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue23942] Explain naming of the patch files in the bug tracker

2016-01-12 Thread Ezio Melotti
Ezio Melotti added the comment: I think this is not worth fixing, for two reasons: 1) we are moving away from Rietveld; 2) even if we document it, most people won't go looking for naming conventions and just use reasonable names (and most of the times they will just work); I'm therefore going

[issue26090] More correct string truncating in PyUnicode_FromFormat()

2016-01-12 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: The C code often uses %. in PyUnicode_FromFormat(). %.200s protects from unlimited output when broken pointer points on random non-null-terminated data. %.200R is used to limit the size of human-readable messages. In all these case formatted string can

[issue26090] More correct string truncating in PyUnicode_FromFormat()

2016-01-12 Thread STINNER Victor
STINNER Victor added the comment: See my old issue #10833 which proposed to *remove* the arbitrary limit on strings. It was rejected. -- ___ Python tracker

[issue25995] os.walk() consumes a lot of file descriptors

2016-01-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > But using FDs proportional to the tree depth seems reasonable to me. This was the main reason for rejecting issue15200. May be we can allow this for globbing, but only explicitly enabled with special parameter or separate functions. The benefit for

Roundup Bug-Tracker 1.5.1 released

2016-01-12 Thread anatoly techtonik
I'm proud to release version 1.5.1 of Roundup which has been possible due to the help of several contributors. This release contains important security enhancements, so make sure to read `doc/upgrading.txt `_ to bring your tracker up to date.

Re: I'm missing something here...

2016-01-12 Thread Erik
On 12/01/16 07:13, Cameron Simpson wrote: On 11Jan2016 23:55, Erik wrote: Is it complaining about that, or is it because the 'for' loop body might be executed zero times? The former. Almost any loop _might_ be executed zero times. Compilers and linters etc should

Need help with this asap.

2016-01-12 Thread ifeanyioprah--- via Python-list
Create a class called BankAccount Create a constructor that takes in an integer and assigns this to a `balance` property. Create a method called `deposit` that takes in cash deposit amount and updates the balance accordingly. Create a method called `withdraw` that takes in cash withdrawal

Installation

2016-01-12 Thread Jansen, Ingram L
I can't download Python and I need it for class. Any suggestions? Ingram Jansen Banner ID: 830742998 -- https://mail.python.org/mailman/listinfo/python-list

[issue25940] SSL tests failed due to expired svn.python.org SSL certificate

2016-01-12 Thread Martin Panter
Martin Panter added the comment: This is a patch against the pythontestdotnet repository to change the certificate to have the CA flag set. It should be applied in conjunction with an (upcoming) update to the test suite, otherwise test_httplib will fail with certificate verification errors.

Re: OT: There are no words for how broken everything is

2016-01-12 Thread Marko Rauhamaa
Rick Johnson : > they have these new inventions now called "blogs", maybe you should > sign up for one? "Sign up for a blog?" What does that mean? Is it like creating a computer program or starting a company: you sign up for one? Anyway, why not use Usenet what it

[issue19006] UnitTest docs should have a single list of assertions

2016-01-12 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks for the review! -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

Tools/libraries to determine the call graph(call flow) of an python program (module/package)

2016-01-12 Thread ashish
Hi Folks, I am trying to do the following. I have a moderately complex python module/application X, whose source code i have access to. I run X with the following command python x.py ... Internally, x.py callls y.py, which in turn calls z.py, etc etc x.py ---> y.py ---> z.py ---> u.py

[issue21047] html.parser.HTMLParser: convert_charrefs should become True by default

2016-01-12 Thread Ezio Melotti
Ezio Melotti added the comment: DeprecationWarnings are silenced by default. You can enable them by using the -W Python flag. They are also enabled while running tests with unittest, so you should have seen them there. -- ___ Python tracker

Re: OT: There are no words for how broken everything is

2016-01-12 Thread Chris Angelico
On Tue, Jan 12, 2016 at 7:30 PM, Marko Rauhamaa wrote: > Rick Johnson : > >> they have these new inventions now called "blogs", maybe you should >> sign up for one? > > "Sign up for a blog?" What does that mean? > > Is it like creating a computer

[issue25913] base64.a85decode adobe flag incorrectly utilizes <~ as a marker causing error

2016-01-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: Soren, for me, the page you link to is impossible to read as it blinks every second or so, something I have never seen before. Perhaps it is trying to forward to the actual reference. As near as I can tell, it just lists about 3 other documents and is not a

[issue26086] Bug in standardmodule os

2016-01-12 Thread Hana Larsen
Hana Larsen added the comment: I thank you much for thisse answer! I Python is in "C:\Python35\" in the root of C-Drive (OS) =-O Den 11-01-2016 kl. 23:57 skrev Eryk Sun: > Eryk Sun added the comment: > > The "yield from" syntax was added in Python 3.3, so somehow you're using the > 3.5 standard

[issue25940] SSL tests failed due to expired svn.python.org SSL certificate

2016-01-12 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: The patch looks good. I only have one question: Why are you removing this part ? ... @@ -1684,13 +1688,8 @@ try: ret = func(*args) except ssl.SSLError as e: -# Note that we get a spurious

[issue26001] Tutorial: write() does not expect string in binary mode

2016-01-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5a2692911a43 by Ezio Melotti in branch '3.5': #26001: mention in the tutorial that files in binary mode expect bytes, not str. https://hg.python.org/cpython/rev/5a2692911a43 New changeset 4b434a4770a9 by Ezio Melotti in branch 'default': #26001:

Re: Which Python editor has this feature?

2016-01-12 Thread Chris Angelico
On Tue, Jan 12, 2016 at 7:27 PM, Terry Reedy wrote: > On 1/11/2016 8:09 PM, Chris Angelico wrote: >> >> On Tue, Jan 12, 2016 at 11:55 AM, Bernardo Sulzbach >> wrote: >>> >>> On Mon, Jan 11, 2016 at 10:14 PM, Chris Angelico >>>

Re: modifying parts of a urlparse.SplitResult

2016-01-12 Thread Tim Chase
On 2016-01-12 13:46, Peter Otten wrote: > Tim Chase wrote: > > >>> u = urlparse.urlsplit(URL) > > >>> lst = list(u) # can't manipulate the tuple directly > > >>> lst[3] = "bar=baz" # 3 = query-string index > > >>> urlparse.urlunsplit(lst) > > 'http://foo/path1/path2/?bar=baz' > > > > It

Re: Need help on a project To :"Create a class called BankAccount with the following parameters "

2016-01-12 Thread lee
You're still struggling with this question because you didn't take your time to read the previous comments here , the solution to this and other question has being posted long ago before new year here , just read previous comments. Remember don't use print , instead use return . --

Re: What use of these _ prefix members?

2016-01-12 Thread me
On 2016-01-10, Peter Otten <__pete...@web.de> wrote: class Derived(Base): > ... def _init(self, x): > ... super()._init(x) > ... print("do something else with", x) > ... Derived(42) > do something with 42 > do something else with 42 ><__main__.Derived object at

Re: use Python and an outlook: protocol URL to bring up a specific email

2016-01-12 Thread eryk sun
On Tue, Jan 12, 2016 at 11:10 AM, Chris Angelico wrote: > On Wed, Jan 13, 2016 at 3:51 AM, jkn wrote: >> I happy to carve some code without using urllib, but I am not clear what I >> actually need to do to 'open' such a URL using this protocol. FWIW I

Re: subscripting Python 3 dicts/getting the only value in a Python 3 dict

2016-01-12 Thread Peter Otten
Ian Kelly wrote: > On Tue, Jan 12, 2016 at 10:12 AM, Terry Reedy wrote: >> Using the values views at intended (as an iterable): >> > dv = d.values() > next(iter(dv)) >> 1 > > Good coding practice also dictates that whenever next is called, the > potential StopIteration

[issue26092] doctest should allow custom sys.displayhook

2016-01-12 Thread Sergey B Kirpichev
New submission from Sergey B Kirpichev: The purpose of doctest's - verify interactive examples. But if your users will use custom displayhook all the time (consider, as examples CAS like SymPy or https://github.com/skirpichev/omg/) - why you must show them examples with the builtin's

Re: Which Python editor has this feature?

2016-01-12 Thread Grant Edwards
On 2016-01-12, Bernardo Sulzbach wrote: > On Mon, Jan 11, 2016 at 10:14 PM, Chris Angelico wrote: >> >> Next IDLE feature request: Can you make it so that, across all >> platforms, it magically installs PostgreSQL and psycopg2? That would >> solve so

[issue25995] os.walk() consumes a lot of file descriptors

2016-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: I like them both, if I had to choose I'd pick patch 2. But yes, we need to add a close() method to the scandir iterator object. In the meantime, I am still worried about what would happen if somehow the loop got interrupted and the frame got kept alive and

[issue26090] More correct string truncating in PyUnicode_FromFormat()

2016-01-12 Thread Guido van Rossum
Guido van Rossum added the comment: Well it seems a little odd to spend effort on a corner case of the C-level error messages if we can't even replicate it in pure Python. -- ___ Python tracker

Re: use Python and an outlook: protocol URL to bring up a specific email

2016-01-12 Thread Chris Angelico
On Wed, Jan 13, 2016 at 4:37 AM, eryk sun wrote: > On Tue, Jan 12, 2016 at 11:10 AM, Chris Angelico wrote: >> On Wed, Jan 13, 2016 at 3:51 AM, jkn wrote: >>> I happy to carve some code without using urllib, but I am not clear what I

[issue26060] Class __dict__ iteration order changing due to type instance key-sharing

2016-01-12 Thread Ionel Cristian Mărieș
Ionel Cristian Mărieș added the comment: As I understood it the issue is not with the order but with the iteration being "unstable" (eg: same key appears multiple times). Yes, the dict is mutated while it's being iterated on, but no keys are added or removed, only values are changed.

[issue26091] decimal.Decimal(0)**0 throws decimal.InvalidOperation

2016-01-12 Thread Joseph Pyott
Changes by Joseph Pyott : -- components: Extension Modules files: decimal pow error.py nosy: Pyottamus priority: normal severity: normal status: open title: decimal.Decimal(0)**0 throws decimal.InvalidOperation type: behavior versions: Python 3.5 Added file:

[issue26091] decimal.Decimal(0)**0 throws decimal.InvalidOperation

2016-01-12 Thread Joseph Pyott
Changes by Joseph Pyott : -- components: +Library (Lib) -Extension Modules ___ Python tracker ___

Re: subscripting Python 3 dicts/getting the only value in a Python 3 dict

2016-01-12 Thread Bernardo Sulzbach
On Tue, Jan 12, 2016 at 3:32 PM, Peter Otten <__pete...@web.de> wrote: > > If there is exactly one item you can unpack: > d = {"Wilf's Cafe": 1} k, = d.values() k > 1 > I personally don't like that trailing comma, it just looks wrong there. But this is very neat. -- Bernardo

[issue26060] Class __dict__ iteration order changing due to type instance key-sharing

2016-01-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Indeed. Here is another version of the script, it crashes when I set PYTHONHASHSEED=1 and passes with PYTHONHASHSEED=3:: class Meta(type): def __new__(meta, clsname, bases, methods): cls = super(Meta, meta).__new__(meta, clsname, bases,

[issue22642] trace module: convert to argparse

2016-01-12 Thread SilentGhost
SilentGhost added the comment: Here is the updated version of the patch that addresses Senthil's comments. Besides re-flowing code, I've also added enforcement of --summary switch and re-factored and expanded the test_failures. It probably would be good if someone could test this on a

Re: subscripting Python 3 dicts/getting the only value in a Python 3 dict

2016-01-12 Thread Marko Rauhamaa
Jussi Piitulainen : > But the most readable thing might be to have a function that extracts > the sole value by whatever means: > >>>> def sole(d): [o] = d.values() ; return o >... >>>> sole(shoe) >3.141592653589793 In the same vein: >>> def

Re: subscripting Python 3 dicts/getting the only value in a Python 3 dict

2016-01-12 Thread Jussi Piitulainen
Nick Mellor writes: > Hi all, > > Seemingly simple problem: > > There is a case in my code where I know a dictionary has only one item > in it. I want to get the value of that item, whatever the key is. > > In Python2 I'd write: > d = {"Wilf's Cafe": 1} d.values()[0] > 1 > > and that'd

Re: use Python and an outlook: protocol URL to bring up a specific email

2016-01-12 Thread Christian Gollwitzer
Am 12.01.16 um 18:52 schrieb Chris Angelico: On Wed, Jan 13, 2016 at 4:37 AM, eryk sun wrote: start is a shell command. It also has a quirk that the first quoted argument is the window title. Here's the correct call: subprocess.check_call('start "title" "%s"' % url,

Re: use Python and an outlook: protocol URL to bring up a specific email

2016-01-12 Thread eryk sun
On Tue, Jan 12, 2016 at 11:52 AM, Chris Angelico wrote: > Is that properly escaped to handle any arbitrary URL? I doubt it. subprocess doesn't know how to quote a command line for the Windows shell, which doesn't follow the rules used by subprocess.list2cmdline. To make matters

Re: I'm missing something here...

2016-01-12 Thread Skip Montanaro
I created an issue for the pylint folks: https://github.com/PyCQA/pylint/issues/774 Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: Need help with this asap.

2016-01-12 Thread Peter Otten
ifeanyioprah--- via Python-list wrote: > Create a class called BankAccount > Create a constructor that takes in an integer and assigns this to a `balance` property. > Create a method called `deposit` that takes in cash deposit amount and updates the balance accordingly. > Create a method called

ANN: Python Meeting Düsseldorf - 19.01.2016

2016-01-12 Thread eGenix Team: M.-A. Lemburg
[This announcement is in German since it targets a local user group meeting in Düsseldorf, Germany] ANKÜNDIGUNG Python Meeting Düsseldorf http://pyddf.de/ Ein Treffen

Re: Installation

2016-01-12 Thread Joel Goldstick
On Mon, Jan 11, 2016 at 8:30 PM, Jansen, Ingram L < ijan...@broncos.uncfsu.edu> wrote: > > I can't download Python and I need it for class. Any suggestions? > > drop the class? ;) But more seriously, what OS, what version of Python, what did you try, what happened? > > Ingram Jansen > Banner

modifying parts of a urlparse.SplitResult

2016-01-12 Thread Tim Chase
I can successfully parse my URLs. However, I'd like to modify a part then reassemble them. However, like tuples, the parts appear to be unmodifiable >>> URL = 'http://foo/path1/path2/?fragment=foo' >>> import urlparse >>> u = urlparse.urlparse(URL) >>> u ParseResult(scheme='http',

Re: modifying parts of a urlparse.SplitResult

2016-01-12 Thread Peter Otten
Tim Chase wrote: > I can successfully parse my URLs. However, I'd like to modify a part > then reassemble them. However, like tuples, the parts appear to be > unmodifiable > > >>> URL = 'http://foo/path1/path2/?fragment=foo' > >>> import urlparse > >>> u = urlparse.urlparse(URL) > >>>

Re: [egenix-info] ANN: Python Meeting Düsseldorf - 19.01.2016

2016-01-12 Thread eGenix Team: M.-A. Lemburg
On 12.01.2016 10:53, eGenix Team: M.-A. Lemburg wrote: > [This announcement is in German since it targets a local user group > meeting in Düsseldorf, Germany] > > > > ANKÜNDIGUNG > > Python Meeting

ANN: Python Meeting Düsseldorf - 19.01.2016

2016-01-12 Thread eGenix Team: M.-A. Lemburg
[This announcement is in German since it targets a local user group meeting in Düsseldorf, Germany] ANKÜNDIGUNG Python Meeting Düsseldorf http://pyddf.de/ Ein Treffen

[issue25913] base64.a85decode adobe flag incorrectly utilizes <~ as a marker causing error

2016-01-12 Thread Zachary Ware
Changes by Zachary Ware : -- nosy: +curioswati ___ Python tracker ___ ___

Re: subscripting Python 3 dicts/getting the only value in a Python 3 dict

2016-01-12 Thread Jussi Piitulainen
Marko Rauhamaa writes: > Jussi Piitulainen: > >> But the most readable thing might be to have a function that extracts >> the sole value by whatever means: >> >>>>> def sole(d): [o] = d.values() ; return o >>... >>>>> sole(shoe) >>3.141592653589793 > > In the same vein: > >

Re: When I need classes?

2016-01-12 Thread Gregory Ewing
Chris Angelico wrote: So start simplistic, and then look into it like this: "Hey, see how you're doing this five times? There HAS to be a better way!" (With acknowledgement to Raymond Hettinger.) That gave me visions of a little animated cartoon of Raymond popping up in the corner of the

It looks like one function not tested by pytest

2016-01-12 Thread Robert
Hi, I modify a test suite, and simplified to the below content. I am interested in function: test_bad_covariance_type() I think that it tests for wrong type input, i.e. 'badcovariance_type' will generate error, which is expected. Thus, it passes test. When a correct type, such as 'diag', is

Re: When I need classes?

2016-01-12 Thread Bernardo Sulzbach
On Tue, Jan 12, 2016 at 7:01 PM, Gregory Ewing wrote: > Chris Angelico wrote: >> >> So start simplistic, and then look >> into it like this: "Hey, see how you're doing this five times? There >> HAS to be a better way!" (With acknowledgement to Raymond Hettinger.) > >

Re: Python installation in windows

2016-01-12 Thread Oscar Benjamin
On 11 January 2016 at 20:16, Cameron Simpson wrote: > On 11Jan2016 07:19, rusi wrote: >> >> On Monday, January 11, 2016 at 6:32:14 PM UTC+5:30, navneet bhatele wrote: >>> >>> I have been trying to install the "python-3.5.1-amd64-webinstall " many >>>

Re: What use of these _ prefix members?

2016-01-12 Thread Jason Swails
On Tue, Jan 12, 2016 at 9:12 AM, me wrote: > On 2016-01-10, Peter Otten <__pete...@web.de> wrote: > class Derived(Base): > > ... def _init(self, x): > > ... super()._init(x) > > ... print("do something else with", x) > > ... > Derived(42) > > do

Sphinx 1.3.4 released

2016-01-12 Thread Takayuki Shimizukawa
Hi all, I'm delighted to announce the release of Sphinx 1.3.4, now available on the Python package index at . It includes about 42 bug fixes for the 1.3 release series, among them a regression in 1.3.3. For the full changelog, go to

Re: What use of these _ prefix members?

2016-01-12 Thread Peter Otten
Someone else posting as "me" wrote: > On 2016-01-10, Peter Otten <__pete...@web.de> wrote: > class Derived(Base): >> ... def _init(self, x): >> ... super()._init(x) >> ... print("do something else with", x) >> ... > Derived(42) >> do something with 42 >> do something

Re: I'm missing something here...

2016-01-12 Thread Ian Kelly
On Mon, Jan 11, 2016 at 6:04 PM, Skip Montanaro wrote: > Sorry, I should have been explicit. prob_dates (the actual argument of the > call) is a set. As far as I know pylint does no type inference, so pylint > can't tell if the LHS and RHS of the |= operator are

[issue26093] __qualname__ different when calling generator object w/ functions.partial

2016-01-12 Thread Dino Viehland
New submission from Dino Viehland: import functools def f(): def g(): yield 1 return g functools.partial(f())().__qualname__ != f()().__qualname__ The qualified name gets passed in via the interpreter loop with _PyEval_EvalCodeWithName calling PyGen_NewWithQualName. If a

[issue24955] webbrowser broken on Mac OS X when using the BROWSER variable

2016-01-12 Thread Simon Conseil
Simon Conseil added the comment: I have looked at the webbrowser tests and it seems not so easy: currently the MacOS browser classes are not tested, and they don't the GenericBrowser base class. Instead they use custom code with os.popen, so it would require some work either replace os.popen

[issue26090] More correct string truncating in PyUnicode_FromFormat()

2016-01-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think we can make this feature available with classic formatting '%.100r', but with new formatting '{0:.100!r}' (especially with f-strings) this can be not so easy. -- ___ Python tracker

[issue26091] decimal.Decimal(0)**0 throws decimal.InvalidOperation

2016-01-12 Thread Stefan Krah
New submission from Stefan Krah: http://speleotrove.com/decimal/daops.html#refpower -- nosy: +skrah resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

Re: subscripting Python 3 dicts/getting the only value in a Python 3 dict

2016-01-12 Thread Peter Otten
Bernardo Sulzbach wrote: > On Tue, Jan 12, 2016 at 3:32 PM, Peter Otten <__pete...@web.de> wrote: >> >> If there is exactly one item you can unpack: >> > d = {"Wilf's Cafe": 1} > k, = d.values() > k >> 1 >> > > I personally don't like that trailing comma, it just looks wrong > there.

Re: subscripting Python 3 dicts/getting the only value in a Python 3 dict

2016-01-12 Thread Bernardo Sulzbach
I saw it in another answer. next(iter(d)) is still the winner. This resembles a list just too much, making the coder's intent harder to understand. This is **very** subjective, of course. -- https://mail.python.org/mailman/listinfo/python-list

Re: Which Python editor has this feature?

2016-01-12 Thread jfong
Terry Reedy at 2016/1/12 UTC+8 3:56:03PM wrote: > Revamping IDLE to 1. use ttk widgets and 2. become a modern single > window app with multiple panes, including a tabbed editor pane, is a > goal for 2016. That will be great, I'm looking forward to it. By the way, when I was playing around with

Re: It looks like one function not tested by pytest

2016-01-12 Thread Robert
On Tuesday, January 12, 2016 at 3:36:13 PM UTC-5, Robert wrote: > Hi, > > I modify a test suite, and simplified to the below content. > I am interested in function: > test_bad_covariance_type() > > I think that it tests for wrong type input, i.e. > 'badcovariance_type' > will generate error,

[issue25924] investigate if getaddrinfo(3) on OSX is thread-safe

2016-01-12 Thread A. Jesse Jiryu Davis
A. Jesse Jiryu Davis added the comment: Related to #1288833, when FreeBSD 5.3's getaddrinfo was declared thread-safe. -- ___ Python tracker ___

[issue24955] webbrowser broken on Mac OS X when using the BROWSER variable

2016-01-12 Thread Senthil Kumaran
Senthil Kumaran added the comment: Simon, sure. It is just for someone, either commiters or other interested folks to add the tests on top of your patch. Agree with you that more change is required to add the required tests. -- ___ Python tracker

[issue26050] Add new StreamReader.readuntil() method

2016-01-12 Thread Марк Коренберг
Changes by Марк Коренберг : -- keywords: +patch Added file: http://bugs.python.org/file41595/asyncio-stream-doc-preliminary.patch ___ Python tracker

Re: When I need classes?

2016-01-12 Thread Ian Kelly
On Mon, Jan 11, 2016 at 5:53 PM, Bernardo Sulzbach wrote: > I have never gone "seriously OO" with Python though. I never wrote > from scratch an application with more than 10 classes as far as I can > remember. However, I would suppose that the interpreter can handle >

[issue26050] Add new StreamReader.readuntil() method

2016-01-12 Thread Марк Коренберг
Марк Коренберг added the comment: Attached patch, but did not compile documentation until text is validated. These descriptions are just copies of docstrings of corresponding functions. -- ___ Python tracker

  1   2   >