[issue26358] mmap.mmap.__iter__ is broken (yields bytes instead of ints)

2016-04-28 Thread Xiang Zhang
Xiang Zhang added the comment: I tried to write a patch to make mmap behave like bytearray more. Making iteration returns int is easy. But I am trapped in the contains operation. To support operation like b'aa' in b'aabbcc', we have to do a str in str search. I don't find any portable way

Re: What should Python apps do when asked to show help?

2016-04-28 Thread Rustom Mody
On Friday, April 29, 2016 at 7:45:35 AM UTC+5:30, Paul Rubin wrote: > Steven D'Aprano writes: > > (1) print the help text to stdout; > > (2) run the help text through a pager; > > Stdout unless the PAGER env var is set. Otherwise, I'd say still stdout > since the person can pipe it through a

[issue10436] tarfile.extractfile in "r|" stream mode fails with filenames or members from getmembers()

2016-04-28 Thread Martin Panter
Martin Panter added the comment: David, if you are still interested, I think specific suggestions or patches would be welcome (even if Lars assigned this to himself five years ago). I also like the idea of separate low-level and random access layers (I also thought of this). One other

[issue23453] Clarify bytes vs text with non-seeking tarfile stream

2016-04-28 Thread Martin Panter
Martin Panter added the comment: Looks like the _Stream docstring needs a similar fix regarding stdin and stdout. Also, it wouldn’t hurt to specify that the read() and write() methods should work with bytes, not text. -- title: Opening a stream with tarfile.open() triggers a

Re: What should Python apps do when asked to show help?

2016-04-28 Thread Paul Rubin
Steven D'Aprano writes: > (1) print the help text to stdout; > (2) run the help text through a pager; Stdout unless the PAGER env var is set. Otherwise, I'd say still stdout since the person can pipe it through a pager if they want, but you could use the pager or be fancy

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-04-28 Thread Martin Panter
Martin Panter added the comment: The obvious (but easy to fix) problem I forsee with Python 3 is the print() calls. If you use print("") and print(arg), that will work with both 2 and 3. There may be more complications with bytes vs text stdout if we change the os.popen() calls to use

Re: Pivot table of Pandas

2016-04-28 Thread Sayth Renshaw
On Friday, 29 April 2016 09:56:13 UTC+10, David Shi wrote: > Hello, Matt, > Please see the web link.Pandas Pivot Table Explained > > |   | > |   |   |   |   |   | > | Pandas Pivot Table ExplainedExplanation of pandas pivot_table function. | > | | > | View on pbpython.com | Preview by Yahoo | >

Re: Controlling the passing of data

2016-04-28 Thread Sayth Renshaw
On Friday, 29 April 2016 01:19:28 UTC+10, Dan Strohl wrote: > If I am reading this correctly... you have something like (you will have to > excuse my lack of knowledge about what kinds of information these actually > are): > > > 1234 > first > > > 5678 > second > > > >

Re: What should Python apps do when asked to show help?

2016-04-28 Thread Steven D'Aprano
On Fri, 29 Apr 2016 07:08 am, Grant Edwards wrote: > On 2016-04-28, Random832 wrote: >> On Thu, Apr 28, 2016, at 15:39, Grant Edwards wrote: >>> That's fine. If you want two or three forms of documentation then you >>> prepare two or three forms of documentation. >>>

[issue26826] Expose new copy_file_range() syscal in os module.

2016-04-28 Thread Martin Panter
Martin Panter added the comment: Yes, having a high-level version of copy_file_range() that falls back to copyfileobj() should be okay. I’m not sure if it should be a public API of shutil, or just an internal detail. I am wondering if it would be nice to rearrange the os.copy_file_range()

Re: Pythonic style

2016-04-28 Thread Chris Angelico
On Fri, Apr 29, 2016 at 10:48 AM, Gregory Ewing wrote: > MRAB wrote: > >> Is it worthy of being in the Zen of Python? > > > +1. Maybe something along the lines of: > >Dunder methods are for defining, not calling. >Unless you're a dunderhead[1]. > > [1] Meant

Re: Pythonic style

2016-04-28 Thread Gregory Ewing
MRAB wrote: Is it worthy of being in the Zen of Python? +1. Maybe something along the lines of: Dunder methods are for defining, not calling. Unless you're a dunderhead[1]. [1] Meant in the sense of an enthusiast, cf. gearhead. -- Greg --

[issue26878] Allow doctest to deep copy globals

2016-04-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm afraid I can't quite see what the problem is. If you're passing your own globs argument, can't you deepcopy it yourself? Could you show a minimal, short example demonstrating the issue please? -- nosy: +steven.daprano versions: +Python 3.6

[issue26879] Spam

2016-04-28 Thread Zachary Ware
Changes by Zachary Ware : -- nosy: -Rogi title: new message -> Spam ___ Python tracker ___

[issue26879] Spam

2016-04-28 Thread Zachary Ware
Changes by Zachary Ware : -- Removed message: http://bugs.python.org/msg264455 ___ Python tracker ___

Pivot table of Pandas

2016-04-28 Thread David Shi via Python-list
Hello, Matt, Please see the web link.Pandas Pivot Table Explained |   | |   |   |   |   |   | | Pandas Pivot Table ExplainedExplanation of pandas pivot_table function. | | | | View on pbpython.com | Preview by Yahoo | | | |   | Debra and Fred have their own groups. How to split the pivot

[issue26879] new message

2016-04-28 Thread Ethan Furman
Changes by Ethan Furman : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___

[issue26879] new message

2016-04-28 Thread Rogi
New submission from Rogi: Hello! You have a new message, please read r...@linuxmail.org -- messages: 264455 nosy: Rogi priority: normal severity: normal status: open title: new message ___ Python tracker

[issue26877] tarfile use wrong code when read from fileobj

2016-04-28 Thread Марк Коренберг
Марк Коренберг added the comment: The same in tarfile.copyfileobj() -- ___ Python tracker ___ ___

[issue26878] Allow doctest to deep copy globals

2016-04-28 Thread DqASe
DqASe added the comment: Alternatively, add an option like deepglobs={...} . The dictionary argument would be deep-copied at each test and added to the environment. -- ___ Python tracker

[issue26878] Allow doctest to deep copy globals

2016-04-28 Thread DqASe
Changes by DqASe : -- components: +Tests -Library (Lib) ___ Python tracker ___ ___

[issue26878] Allow doctest to deep copy globals

2016-04-28 Thread DqASe
New submission from DqASe: Currently doctest makes shallow copies of the environment or globs argument. This is somewhat un-symmetrical: on the one hand, a test cannot see variables created by another, but on the other, it can alter mutable objects. This is inconvenient e.g. when

[issue26877] tarfile use wrong code when read from fileobj

2016-04-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +lars.gustaebel ___ Python tracker ___ ___

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-04-28 Thread Michael Felt
Michael Felt added the comment: I have not looked specifically, at least not that I remember, for differences in util/ctypes in python2 and python3. Will do so tomorrow. I did just look briefly at the library, rather archive, built by default as libpython2.7.a - it is static members only,

[issue26877] tarfile use wrong code when read from fileobj

2016-04-28 Thread Марк Коренберг
New submission from Марк Коренберг: tarfile.py: _FileInFile(): (near line 687) b = self.fileobj.read(length) if len(b) != length: raise ReadError("unexpected end of data") every read() API does not guarantee that it will read `length` bytes. So, if fileobj reads less than requestedm that

Re: What should Python apps do when asked to show help?

2016-04-28 Thread Grant Edwards
On 2016-04-28, Random832 wrote: > On Thu, Apr 28, 2016, at 15:39, Grant Edwards wrote: >> That's fine. If you want two or three forms of documentation then you >> prepare two or three forms of documentation. >> >> Adding an option to run the default 'help' output through

[issue26876] Extend MSVCCompiler class to respect environment variables

2016-04-28 Thread Steve Dower
Steve Dower added the comment: I'm neutral about applying it to 2.7, though I can see the value in doing so. For 3.5 it definitely has to modify _msvccompiler - the other two modules are just left behind to distract people apparently :) (but actually in case someone accidentally(?) too a

[issue26876] Extend MSVCCompiler class to respect environment variables

2016-04-28 Thread Zachary Ware
Zachary Ware added the comment: I can't seem to get the patch to apply, could you please regenerate it against a fresh checkout of https://hg.python.org/cpython#default (or 'master' of github.com/python/cpython)? This looks fairly straightforward, but I'm far from an expert on distutils :).

[issue26876] Extend MSVCCompiler class to respect environment variables

2016-04-28 Thread Zachary Ware
Changes by Zachary Ware : -- nosy: +christopher.hogan ___ Python tracker ___ ___

Re: What should Python apps do when asked to show help?

2016-04-28 Thread Cameron Simpson
On 29Apr2016 03:06, Chris Angelico wrote: On Fri, Apr 29, 2016 at 2:33 AM, Steven D'Aprano wrote: I have an application written in Python which accepts -h or --help to show help. I can: (1) print the help text to stdout; (2) run the help text through a

Re: Have I ofended someone?

2016-04-28 Thread alister
On Thu, 28 Apr 2016 20:11:27 +, alister wrote: > I don't see my posts appearing, posting to news group using Pan on > Linux. > posts to other news groups are fine No just going blind Someone top-posted to my last reply & then everything got snipped to restore readability. -- Be careful

Have I ofended someone?

2016-04-28 Thread alister
I don't see my posts appearing, posting to news group using Pan on Linux. posts to other news groups are fine -- Just about every computer on the market today runs Unix, except the Mac (and nobody cares about it). -- Bill Joy 6/21/85 --

Re: Have I ofended someone?

2016-04-28 Thread Marko Rauhamaa
alister : > I don't see my posts appearing, posting to news group using Pan on > Linux. posts to other news groups are fine Take yourself out of your killfile. Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: What should Python apps do when asked to show help?

2016-04-28 Thread Random832
On Thu, Apr 28, 2016, at 15:39, Grant Edwards wrote: > That's fine. If you want two or three forms of documentation then you > prepare two or three forms of documentation. > > Adding an option to run the default 'help' output through a pager or > display it in a web browser doesn't somehow force

[issue22477] GCD in Fractions

2016-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Is there something to do with this issue? -- nosy: +serhiy.storchaka status: open -> pending ___ Python tracker ___

[issue26875] mmap doc gives wrong code example

2016-04-28 Thread Zachary Ware
Zachary Ware added the comment: Thanks for the report and patch! -- nosy: +zach.ware versions: +Python 3.5, Python 3.6 ___ Python tracker ___

[issue26875] mmap doc gives wrong code example

2016-04-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5c8e1b98dc3f by Zachary Ware in branch '3.5': Issue #26875: Fix mmap example https://hg.python.org/cpython/rev/5c8e1b98dc3f New changeset aaf2ad84ae1c by Zachary Ware in branch 'default': Closes #26875: Merge with 3.5

[issue26873] xmlrpclib raises when trying to convert an int to string when unicode is available

2016-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch makes xmlrpc unmarshaller to be more strong and raise ValueError instead of returning incorrect value when encounters with unsupported value type. The unmarshaller still skips unknown tags silently if they are occurred outside of the "value"

[issue26874] Docstring error in divmod function

2016-04-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5a578ec4b3b3 by Zachary Ware in branch '2.7': Issue #26874: Simplify the divmod docstring. https://hg.python.org/cpython/rev/5a578ec4b3b3 New changeset 3edf8aa1ed97 by Zachary Ware in branch '3.5': Issue #26874: Simplify the divmod docstring

Re: What should Python apps do when asked to show help?

2016-04-28 Thread Grant Edwards
On 2016-04-28, Marko Rauhamaa wrote: > Grant Edwards : > >> On 2016-04-28, Random832 wrote: >>> One disadvantage is that you have to compose two forms of >>> documentation. >> >> Only if you want two forms of documentation. >>

[issue26874] Docstring error in divmod function

2016-04-28 Thread Zachary Ware
Zachary Ware added the comment: If only I had reloaded the page before pushing... Btw, this was first reported in issue1209411, but only the docs were changed, not the docstring. -- nosy: +zach.ware resolution: fixed -> stage: resolved -> status: closed -> open

[issue26874] Docstring error in divmod function

2016-04-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset fb49082a75d1 by Zachary Ware in branch '2.7': Issue #26874: Make divmod docstring and full doc match https://hg.python.org/cpython/rev/fb49082a75d1 New changeset ef193be5c3cd by Zachary Ware in branch '3.5': Issue #26874: Fix divmod docstring

[issue26874] Docstring error in divmod function

2016-04-28 Thread Mark Dickinson
Mark Dickinson added the comment: > I think it should be ((x-x%y)//y, x%y) where an integer division is used. How about simply (x//y, x%y)? -- ___ Python tracker

Re: Simplest way to locate a string in a column and get the value on the same row in another column

2016-04-28 Thread Tim Chase
On 2016-04-28 18:37, David Shi via Python-list wrote: > What is the simplest way to locate a string in a column and get > the value on the same row in another column ? 1  a2  b3  c > Locate b and obtain 2 in a table. > Looking forward to hearing from you. I've had success with using regexp

Re: Simplest way to locate a string in a column and get the value on the same row in another column

2016-04-28 Thread John Gordon
In David Shi writes: > What is the simplest way to locate a string in a column and get the value > on the same row in another column ? You haven't given enough context for us to be able to answer. Are you talking

Simplest way to locate a string in a column and get the value on the same row in another column

2016-04-28 Thread David Shi via Python-list
What is the simplest way to locate a string in a column and get the value on the same row in another column ? 1  a2  b3  c Locate b and obtain 2 in a table. Looking forward to hearing from you. Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Best way to do subversion stuff

2016-04-28 Thread Grant Edwards
I'd like to write some small command-line utilities to do some tasks in subversion: * Do a commit that includes all modified externals. * Do a status that includes status of all externals. * Do a log that combines logs of . and all externals. There appear to be three options: 1) pysvn

Re: What should Python apps do when asked to show help?

2016-04-28 Thread Marko Rauhamaa
Grant Edwards : > On 2016-04-28, Random832 wrote: >> One disadvantage is that you have to compose two forms of >> documentation. > > Only if you want two forms of documentation. > > If you add an option to run the help info through a pager, I

Re: What should Python apps do when asked to show help?

2016-04-28 Thread Grant Edwards
On 2016-04-28, Random832 wrote: > > > On Thu, Apr 28, 2016, at 13:33, Grant Edwards wrote: >> As long as -? -h --help just write stuff to stdout you can add >> whatever other options you like that run pagers, start up web >> browsers, or show mp4 movies on the wall without

[issue26876] Extend MSVCCompiler class to respect environment variables

2016-04-28 Thread Rohit Jamuar
New submission from Rohit Jamuar: The UnixCompiler class respects flags (CC, LD, AR, CFLAGS and LDFLAGS) set to the environment, whereas MSVCCompiler class does not. This change allows building CPython and any module that invokes distutils to utilize flags and executables that have been set

[issue26874] Docstring error in divmod function

2016-04-28 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +eric.smith, lemburg, mark.dickinson, stutzbach ___ Python tracker ___

RE: What should Python apps do when asked to show help?

2016-04-28 Thread Dan Strohl via Python-list
Yup.. another reason to use something like argparse... you define the argument descriptions, help, and when you raise an error, it automatically handles the output, sending it to the right place (stderr/stdout)... as well as allowing you to define different levels of verbosity easily... (or not

Re: What should Python apps do when asked to show help?

2016-04-28 Thread Marko Rauhamaa
Irmen de Jong : > An idea: Use just one help option, then > > if sys.stdout.isatty(): > #use a pager to display help text > else: > #print all help text normally I've seen that used, but I find it annoying:

Re: What should Python apps do when asked to show help?

2016-04-28 Thread Random832
On Thu, Apr 28, 2016, at 13:33, Grant Edwards wrote: > As long as -? -h --help just write stuff to stdout you can add > whatever other options you like that run pagers, start up web > browsers, or show mp4 movies on the wall without annoying grouchy old > Unix users like me. ;) One

Re: What should Python apps do when asked to show help?

2016-04-28 Thread Jussi Piitulainen
Steven D'Aprano writes: > I have an application written in Python which accepts -h or --help to > show help. I can: > > (1) print the help text to stdout; > > (2) run the help text through a pager; > > (3) do something else? > > > Many command line tools simply output help to stdout (or stderr,

[issue26875] mmap doc gives wrong code example

2016-04-28 Thread Xiang Zhang
New submission from Xiang Zhang: The code given in mmap doc import mmap with mmap.mmap(-1, 13) as mm: mm.write("Hello world!") should be mm.write(b"Hello world!") The *b* is left out and then causes exception. -- assignee: docs@python components: Documentation files:

RE: What should Python apps do when asked to show help?

2016-04-28 Thread Dan Strohl via Python-list
I would hesitate to take this approach unless the tool was one that only I was going to be using, and I knew exactly what environments it was going to be in. I know that many of the system items in python work differently in different operating systems, and different os's report things

Re: What should Python apps do when asked to show help?

2016-04-28 Thread Grant Edwards
On 2016-04-28, Steven D'Aprano wrote: > I have an application written in Python which accepts -h or --help to show > help. I can: > > (1) print the help text to stdout; Yep: just write it to stdout. > (2) run the help text through a pager; If you do (1), and I can do that

Re: What should Python apps do when asked to show help?

2016-04-28 Thread Random832
On Thu, Apr 28, 2016, at 13:06, Chris Angelico wrote: > On Fri, Apr 29, 2016 at 2:33 AM, Steven D'Aprano > wrote: > > Many command line tools simply output help to stdout (or stderr, if they're > > evil), > > I'm not sure stderr is particularly more evil than stdout, but

Re: What should Python apps do when asked to show help?

2016-04-28 Thread Ethan Furman
On 04/28/2016 10:02 AM, Dan Strohl via Python-list wrote: I would suggest using argparse https://docs.python.org/3/library/argparse.html as it handles all of that natively... On the other hand, if you feel that argparse is akin to using a canon to kill a mosquito, you can try scription*:

RE: What should Python apps do when asked to show help?

2016-04-28 Thread Dan Strohl via Python-list
Yeah, if I am handling arguments from the command line, I use argparse, if I am doing a cli based app (so, going back and forth in interacting with the command line), I would look at clint (https://github.com/kennethreitz/clint) As many people have said here, don’t reinvent the wheel. Dan

Re: What should Python apps do when asked to show help?

2016-04-28 Thread John Wong
On Thu, Apr 28, 2016 at 1:02 PM, Dan Strohl via Python-list < python-list@python.org> wrote: > I would suggest using argparse > https://docs.python.org/3/library/argparse.html as it handles all of that > natively... including validating arguments, showing errors, help, etc... > however, assuming

Re: What should Python apps do when asked to show help?

2016-04-28 Thread Chris Angelico
On Fri, Apr 29, 2016 at 2:33 AM, Steven D'Aprano wrote: > I have an application written in Python which accepts -h or --help to show > help. I can: > > (1) print the help text to stdout; > > (2) run the help text through a pager; > > (3) do something else? > > > Many command

Re: What should Python apps do when asked to show help?

2016-04-28 Thread Irmen de Jong
On 28-4-2016 18:33, Steven D'Aprano wrote: > but I was thinking of doing both: give my application a subcommand or an > option to display help directly in a pager, while -h and --help print to > stdout as normal. > > What do you think? Too clever? An idea: Use just one help option, then if

RE: What should Python apps do when asked to show help?

2016-04-28 Thread Dan Strohl via Python-list
I would suggest using argparse https://docs.python.org/3/library/argparse.html as it handles all of that natively... including validating arguments, showing errors, help, etc... however, assuming you don't want to; Send it to stdout, that allows the user to redirect it if they want to (and

[issue26874] Docstring error in divmod function

2016-04-28 Thread mbarao
mbarao added the comment: See divmod.__doc__ -- ___ Python tracker ___ ___ Python-bugs-list mailing list

Re: How to get the closure environment in Python?

2016-04-28 Thread Rob Gaddi
Jin Li wrote: > Hi all, > > I want to get the closure environment in Python. As in the following example: > > def func1(): > x = 10 > def func2(): > return 0 > > return func2 > > f=func1() > print f() > > > How could I get the variable `x` in the

[issue26873] xmlrpclib raises when trying to convert an int to string when unicode is available

2016-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Minimal reproducer: >>> xmlrpclib.loads('ab') (({'a': 'b'},), None) The workaround for your particular case, Nathan: xmlrpclib.Unmarshaller.dispatch['ex:nil'] = xmlrpclib.Unmarshaller.dispatch['nil'] -- ___

Re: How to get the closure environment in Python?

2016-04-28 Thread Steven D'Aprano
On Fri, 29 Apr 2016 02:23 am, Jin Li wrote: > I want to get the closure environment in Python. As in the following > example: > > def func1(): > x = 10 > def func2(): > return 0 > return func2 > > f=func1() > print f() > > > How could I get the variable

Re: What should Python apps do when asked to show help?

2016-04-28 Thread Ethan Furman
On 04/28/2016 09:33 AM, Steven D'Aprano wrote: I have an application written in Python which accepts -h or --help to show help. I can: (1) print the help text to stdout; (2) run the help text through a pager; (3) do something else? I think if the user is proficient enough to: a) run the

Re: What should Python apps do when asked to show help?

2016-04-28 Thread alister
On Fri, 29 Apr 2016 02:33:56 +1000, Steven D'Aprano wrote: > I have an application written in Python which accepts -h or --help to > show help. I can: > > (1) print the help text to stdout; > > (2) run the help text through a pager; > > (3) do something else? > > > Many command line tools

Re: How to get the closure environment in Python?

2016-04-28 Thread Yuan Cao
On Thu, Apr 28, 2016 at 12:23 PM, Jin Li wrote: > Hi all, > > I want to get the closure environment in Python. As in the following > example: > > def func1(): > x = 10 > def func2(): > return 0 > > return func2 > > f=func1() > print

What should Python apps do when asked to show help?

2016-04-28 Thread Steven D'Aprano
I have an application written in Python which accepts -h or --help to show help. I can: (1) print the help text to stdout; (2) run the help text through a pager; (3) do something else? Many command line tools simply output help to stdout (or stderr, if they're evil), which makes it easy to

[issue26874] Docstring error in divmod function

2016-04-28 Thread Emanuel Barry
Emanuel Barry added the comment: The documentation looks fine to me. Are you seeing any other place that I'm missing? https://docs.python.org/3/library/functions.html#divmod -- nosy: +ebarry ___ Python tracker

How to get the closure environment in Python?

2016-04-28 Thread Jin Li
Hi all, I want to get the closure environment in Python. As in the following example: def func1(): x = 10 def func2(): return 0 return func2 f=func1() print f() How could I get the variable `x` in the environment of `func2()`? i.e. `f()`. Best

[issue26874] Docstring error in divmod function

2016-04-28 Thread mbarao
New submission from mbarao: The documentation of the divmod function says that a tuple ((x-x%y)/y, x%y) is returned, but this is not correct anymore for python3. I think it should be ((x-x%y)//y, x%y) where an integer division is used. -- assignee: docs@python components: Documentation

[issue26826] Expose new copy_file_range() syscal in os module.

2016-04-28 Thread Marcos Dione
Marcos Dione added the comment: I managed to modify the congigure.ac file so it includes the proper test. after I run autoconf it generated the proper configure script, but I also needed to run autoheaders (both run by make autoconf). This last command modified a generated file that's in the

[issue26868] Document PyModule_AddObject's behavior on error

2016-04-28 Thread Berker Peksag
Changes by Berker Peksag : -- title: Incorrect check for return value of PyModule_AddObject in _csv.c -> Document PyModule_AddObject's behavior on error ___ Python tracker

RE: Controlling the passing of data

2016-04-28 Thread Dan Strohl via Python-list
If I am reading this correctly... you have something like (you will have to excuse my lack of knowledge about what kinds of information these actually are): 1234 first 5678 second And you want something like: nominations = [(1,1234), (2,5678)] meetings =

[issue26871] Change weird behavior of PyModule_AddObject()

2016-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Removed changes in _decimal.c and deprecation. Used Py_XDECREF in _PyModule_AddObject(). -- Added file: http://bugs.python.org/file42639/pymodule_addobject_2.patch ___ Python tracker

Re: online python courses

2016-04-28 Thread Rustom Mody
On Thursday, April 28, 2016 at 7:45:22 PM UTC+5:30, ldomp...@casema.nl wrote: > I am follows on this moment two online pythoncourses from code.tutsplus.com > But I am interested in following more online pythoncourses. > Maby someone have some links to websites for me what handles python online >

Re: online python courses

2016-04-28 Thread justin walters
On Thu, Apr 28, 2016 at 7:57 AM, Joel Goldstick wrote: > On Thu, Apr 28, 2016 at 10:15 AM, wrote: > > I am follows on this moment two online pythoncourses from > code.tutsplus.com > > But I am interested in following more online pythoncourses. >

RE: online python courses

2016-04-28 Thread Dan Strohl via Python-list
I've heard good things about codeacademy.com and learnpython.org. Also, I've heard that pycharm educational edition is helpful. (https://www.jetbrains.com/pycharm-edu/ ) I haven't personally tried any of these though, so your mileage may vary. Good Luck! Dan Strohl > -Original

Re: online python courses

2016-04-28 Thread Joel Goldstick
On Thu, Apr 28, 2016 at 10:15 AM, wrote: > I am follows on this moment two online pythoncourses from code.tutsplus.com > But I am interested in following more online pythoncourses. > Maby someone have some links to websites for me what handles python online > courses. > >

Re: Controlling the passing of data

2016-04-28 Thread Rustom Mody
On Thursday, April 28, 2016 at 8:11:26 PM UTC+5:30, Dan Strohl wrote: > In addition to Peter's points, > - I would suggest breaking out the list comprehensions into standard for > loops and/or functions. That makes it easier to read and troubleshoot. (you > can always re-optimize It if

RE: Controlling the passing of data

2016-04-28 Thread Dan Strohl via Python-list
In addition to Peter's points, - I would suggest breaking out the list comprehensions into standard for loops and/or functions. That makes it easier to read and troubleshoot. (you can always re-optimize It if needed.) - Peter's point about making things into functions will also help

[issue26859] unittest fails with "Start directory is not importable"

2016-04-28 Thread Robert Collins
Robert Collins added the comment: Could you please add a test case. -- nosy: +rbcollins stage: patch review -> test needed ___ Python tracker ___

online python courses

2016-04-28 Thread ldompeling
I am follows on this moment two online pythoncourses from code.tutsplus.com But I am interested in following more online pythoncourses. Maby someone have some links to websites for me what handles python online courses. thanks -- https://mail.python.org/mailman/listinfo/python-list

[issue26826] Expose new copy_file_range() syscal in os module.

2016-04-28 Thread Marcos Dione
Marcos Dione added the comment: I'll do the copyfile() part once I'm convinced it doesn't break anything else. -- title: Expose new copy_file_range() syscal in os module and use it to improve shutils.copy() -> Expose new copy_file_range() syscal in os module.

Re: Controlling the passing of data

2016-04-28 Thread Sayth Renshaw
> > Your actual problem is drowned in too much source code. Can you restate it > in English, optionally with a few small snippets of Python? > > It is not even clear what the code you provide should accomplish once it's > running as desired. > > To give at least one code-related advice: You

Re: Controlling the passing of data

2016-04-28 Thread Peter Otten
Sayth Renshaw wrote: > In my file here I needed to traverse and modify the XML file I don't want > to restore it or put it in a new variable or other format I just want to > alter it and let it flow onto the list comprehensions as they were. That looks like an arbitrary limitation to me. It's a

Re: Why does pathlib not have is_readable() & things like that?

2016-04-28 Thread Grant Edwards
On 2016-04-28, Adam Funk wrote: > On 2016-04-26, Random832 wrote: > >> On Tue, Apr 26, 2016, at 09:30, Adam Funk wrote: >>> I recently discovered pathlib in the Python 3 standard library, & find >>> it very useful, but I'm a bit surprised that it doesn't offer things >>>

Re: Pythonic style

2016-04-28 Thread Random832
On Thu, Apr 28, 2016, at 01:16, Rustom Mody wrote: > On Thursday, April 28, 2016 at 9:26:21 AM UTC+5:30, Chris Angelico wrote: > > My rule of thumb is: Dunders are for defining, not for calling. It's > > not a hard-and-fast rule, but it'll get you through 99%+ of > > situations. > > Neat and

Re: Why does pathlib not have is_readable() & things like that?

2016-04-28 Thread Jussi Piitulainen
Adam Funk writes: > On 2016-04-26, Random832 wrote: > >> On Tue, Apr 26, 2016, at 09:30, Adam Funk wrote: >>> I recently discovered pathlib in the Python 3 standard library, & find >>> it very useful, but I'm a bit surprised that it doesn't offer things >>> like is_readable() and is_writable. Is

Re: Dunder docs again (was Pythonic style)

2016-04-28 Thread MRAB
On 2016-04-28 13:25, Marko Rauhamaa wrote: MRAB : 'pythonic-ness'? Surely it's 'pythonicity'! :-) Doubt it: Full Definition of generic [...] —generically \-i-k(ə-)lē\ adverb —genericness noun http://www.merriam-webster.com/dictionary/generic> I can

Re: Why does pathlib not have is_readable() & things like that?

2016-04-28 Thread Adam Funk
On 2016-04-26, Random832 wrote: > On Tue, Apr 26, 2016, at 09:30, Adam Funk wrote: >> I recently discovered pathlib in the Python 3 standard library, & find >> it very useful, but I'm a bit surprised that it doesn't offer things >> like is_readable() and is_writable. Is there a good reason for

[issue26826] Expose new copy_file_range() syscal in os module and use it to improve shutils.copy()

2016-04-28 Thread Marcos Dione
Marcos Dione added the comment: > About changing copyfileobj(), here are some test cases which may help explain > the compatibility problems: I see, I was expecting something like that after reading https://bugs.python.org/issue25063 's conclusions. I removed that part. > Perhaps we could

Re: Why does pathlib not have is_readable() & things like that?

2016-04-28 Thread Adam Funk
On 2016-04-26, Steven D'Aprano wrote: > On Tue, 26 Apr 2016 11:30 pm, Adam Funk wrote: >> I've been improvising with things like this: >> >> import pathlib, os >> >> path = pathlib.Path('some/directory') >> writable = os.access(str(path), os.W_OK | os.X_OK) >> >> Is that the best way to do

Re: Dunder docs again (was Pythonic style)

2016-04-28 Thread Marko Rauhamaa
MRAB : > 'pythonic-ness'? Surely it's 'pythonicity'! :-) Doubt it: Full Definition of generic [...] —generically \-i-k(ə-)lē\ adverb —genericness noun http://www.merriam-webster.com/dictionary/generic> Marko --

[issue24114] ctypes.utils uninitialized variable 'paths'

2016-04-28 Thread Meador Inge
Meador Inge added the comment: Xiang's patch LGTM. Given that Kees has verified it, I will apply today. -- assignee: -> meador.inge stage: needs patch -> commit review ___ Python tracker

  1   2   >