[issue26074] Add a method to pip.. pip.require("package_name")

2016-01-10 Thread Blaize Rhodes
New submission from Blaize Rhodes: The idea is to add a method to pip that tries to import a package and if the import fails then try to download and install the package handling the UI. Yes, you can put the package as a dependency in your pip config for your code. This is intended for the

[issue26074] Add a method to pip.. pip.require("package_name")

2016-01-10 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: But in fact, Pip is an external project to CPython. Could you explain why you post this issue in the CPython Bug Tracker? Thank you -- nosy: +matrixise ___ Python tracker

[issue26071] bdist_wininst created binaries fail to start and find 32bit Pythons

2016-01-10 Thread Mark Hammond
Mark Hammond added the comment: > Mark said the "built binary links against the DLL version of the CRT > but I just checked in 3.5.1 that you actually didn't switch that > one to link against vcruntime140.dll like you did with everything else Yeah, I didn't dig too much further here, but I'm

[issue25986] Collections.deque maxlen: added in 2.6 or 2.7?

2016-01-10 Thread Elena Oat
Elena Oat added the comment: I checked and 2.6 python has maxlen as a parameter, but not a maxlen attribute. The maxlen attribute was added in 2.7. -- nosy: +Elena.Oat ___ Python tracker

[issue26075] typing.Union unifies types too broadly

2016-01-10 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti stage: -> test needed ___ Python tracker ___

[issue25517] regex howto example in "Lookahead Assertions"

2016-01-10 Thread Elena Oat
Elena Oat added the comment: Corrected the regular expression and documented why [^.]* is used. -- keywords: +patch nosy: +Elena.Oat Added file: http://bugs.python.org/file41566/issue25517.diff ___ Python tracker

[issue25967] Devguide: add 2to3 to the "Changing CPython's Grammar" checklist

2016-01-10 Thread Chris Thomas
Chris Thomas added the comment: Added a note to the check list as needed. -- keywords: +patch nosy: +Aegil Added file: http://bugs.python.org/file41567/issue25967.patch ___ Python tracker

[issue25986] Collections.deque maxlen: added in 2.6 or 2.7?

2016-01-10 Thread Ezio Melotti
Ezio Melotti added the comment: Thanks for checking. Closing. -- nosy: +ezio.melotti resolution: -> not a bug stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue26070] Launcher fails to find in-place built binaries from earlier Python versions

2016-01-10 Thread Vinay Sajip
Vinay Sajip added the comment: Hey, Steve, don't shut me out, I'm still here ;-) I've had a heavy consulting load for the past year or so which means I can't always deal with issues as quickly as before. If someone else fixes issues before I get to them, it's fine by me :-) IMO the proposed

[issue26074] Add a method to pip.. pip.require("package_name")

2016-01-10 Thread Blaize Rhodes
Blaize Rhodes added the comment: I'm more than happy to fill in the contributor agreement.. but it seems like a hassle if, what I'm assuming will happen, someone points out a good reason why this hasn't been done already. -- ___ Python tracker

[issue26075] typing.Union unifies types too broadly

2016-01-10 Thread Alex Grönholm
New submission from Alex Grönholm: >>> from typing import Union, Iterable >>> Union[str, Iterable[int]] typing.Iterable[int] The union loses the "str" parameter because issubclass(str, collections.abc.Iterable) returns True and the check completely disregards generics. Guido mentioned that

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

2016-01-10 Thread lilydjwg
lilydjwg added the comment: FYI, this breaks one of my programs. I find it now because it only threw errors in rare cases, and I've never seen the deprecated warning because I don't check the logs unless something goes wrong. -- nosy: +lilydjwg ___

[issue19316] devguide: compiler - wording

2016-01-10 Thread Elena Oat
Elena Oat added the comment: Here's the patch regenerated for the latest devguide. -- nosy: +Elena.Oat Added file: http://bugs.python.org/file41568/issue19316.diff ___ Python tracker

[issue26071] bdist_wininst created binaries fail to start and find 32bit Pythons

2016-01-10 Thread Eryk Sun
Eryk Sun added the comment: > why isn't the directory containing the loaded DLL searched > for dependencies? That's possible. The loader provides several ways to go about solving this problem. The directory of the DLL can be added to the search path if you use LoadLibraryEx with the flag

[issue19251] bitwise ops for bytes of equal length

2016-01-10 Thread cowlicks
cowlicks added the comment: I've attached a diff that adds ^, |, and & to bytes and bytearray object on the master branch (err the analogous hg thing). It also includes a test file which definitely is in the wrong place, but demonstrates what is working. Personally this came up while I was

[issue25596] regular files handled as directories in the glob module

2016-01-10 Thread Xavier de Gaye
Changes by Xavier de Gaye : Added file: http://bugs.python.org/file41571/glob_scandir_3.patch ___ Python tracker ___

[issue25596] regular files handled as directories in the glob module

2016-01-10 Thread Xavier de Gaye
Xavier de Gaye added the comment: FWIW I have followed the idea of having _iterdir() yielding the DirEntry entry instead of the name in Serhiy's patch. There is a slight performance gain. Now _glob0() and _glob1() do return a list of directories when dironly is true but there is now another

[issue19251] bitwise ops for bytes of equal length

2016-01-10 Thread Andrew Barnert
Andrew Barnert added the comment: On Jan 10, 2016, at 06:48, cowlicks wrote: > > > Personally this came up while I was playing with toy crypto problems. I > expected to already be part of the language, but it wasn't. I think this is a > natural expectation. Maybe if

[issue26071] bdist_wininst created binaries fail to start and find 32bit Pythons

2016-01-10 Thread Steve Dower
Steve Dower added the comment: Ultimately, launching python.exe is better than loading python##.dll here because it avoids DLL planting vulnerabilities, but I'm honestly a little surprised still that LoadLibrary won't resolve vcruntime in this case. Been a while since I looked, and I haven't

[issue22570] Better stdlib support for Path objects

2016-01-10 Thread Ram Rachum
Ram Rachum added the comment: Here's an alternate idea I thought of now. Maybe `path.path` should be a pointer to the same `Path` object, so every function will do this: str(arg.path) if hasattr(arg, 'path') else arg What I like about this is that it avoids having the path argument be a

[issue26070] Launcher fails to find in-place built binaries from earlier Python versions

2016-01-10 Thread Steve Dower
Steve Dower added the comment: > I've had a heavy consulting load for the past year or so which means I can't > always deal with issues as quickly as before. That explains it :) With so little visibility into what we're doing outside of Python it's hard to know. Glad you're still about.

[issue22570] Better stdlib support for Path objects

2016-01-10 Thread Brett Cannon
Brett Cannon added the comment: I appreciate the thought, Ram, but I'm not a fan. -- ___ Python tracker ___

[issue26071] bdist_wininst created binaries fail to start and find 32bit Pythons

2016-01-10 Thread Steve Dower
Steve Dower added the comment: > The directory of the DLL can be added to the search path if you use > LoadLibraryEx with the flag LOAD_WITH_ALTERED_SEARCH_PATH and use an absolute > path. That sounds like the better fix then. I thought there was something along those lines available. We

[issue13963] dev guide has no mention of mechanics of patch review

2016-01-10 Thread Ezio Melotti
Ezio Melotti added the comment: Since we are moving away from rietveld, I'm going to close this as out of date. -- resolution: -> out of date stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue26074] Add a method to pip.. pip.require("package_name")

2016-01-10 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the report, but this should be discussed either at https://groups.google.com/forum/#!forum/pypa-dev or https://github.com/pypa/pip/issues -- nosy: +berker.peksag resolution: -> third party stage: -> resolved status: open -> closed

[issue26030] Use PEP8 in documentation examples

2016-01-10 Thread Ezio Melotti
Ezio Melotti added the comment: > I'll slowly review what I see, and provide little patches from > time to time, only when the PEP8 infringement look obvious. Sounds good to me. If you are not sure you can ask on IRC (#python-dev on freenode) or the core-mentorship mailing list. --

[issue26077] Make slicing of immutable structures return a view instead of a copy

2016-01-10 Thread Filip Haglund
New submission from Filip Haglund: Slicing tuples returns a copy, which is O(n) time. This could be O(1) since tuples are immutable, by just pointing to the same data. This probably applies to other immutable structures as well, such as strings. -- components: Interpreter Core

[issue26078] Python launcher options enhancement

2016-01-10 Thread Edward
New submission from Edward: The Python launcher in Windows is a neat tool for running multiple versions of Python 2 and Python 3 at different times. It allows as options the ability to specify the latest version of either Python 2 or Python 3 defaulting to the 64-bit version if both exist, or

[issue1753718] base64 "legacy" functions violate RFC 3548

2016-01-10 Thread Martin Panter
Martin Panter added the comment: Uploaded a Python 3 patch to Issue 22088 which includes the doc string changes. -- ___ Python tracker ___

[issue25596] regular files handled as directories in the glob module

2016-01-10 Thread Xavier de Gaye
Xavier de Gaye added the comment: Actually the microbenchmarks comparison between glob_scandir_2.patch and glob_scandir_3.patch must be made by removing the call to entry.is_symlink() also in glob_scandir_2.patch. In that case the microbenchmarks give about the same results for each patch.

[issue26077] Make slicing of immutable structures return a view instead of a copy

2016-01-10 Thread Emanuel Barry
Emanuel Barry added the comment: This is an interesting idea, +1 from me. Do you want to submit a patch? -- nosy: +ebarry stage: -> needs patch versions: -Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker

[issue26077] Make slicing of immutable structures return a view instead of a copy

2016-01-10 Thread Martin Panter
Martin Panter added the comment: I think which technique (copy or view) is better depends on the situation. If you are making a large temporary slice, a view may be more efficient. But if you are making a long-term slice and don’t need the original any more, a copy would allow the original

[issue26076] redundant checks in tok_get in Parser\tokenizer.c

2016-01-10 Thread Oren Milman
Oren Milman added the comment: Sorry for being so clueless. The diff is attached. I manually did some checks to verify that relevant stuff work correctly (the imaginary number 0j, and fractions starting with '0.'). I run 'python -m test', and got the following output: 352 tests OK. 1 test