Re: Classic OOP in Python

2015-06-18 Thread Jason P.
El miércoles, 17 de junio de 2015, 21:44:51 (UTC+2), Ned Batchelder escribió: On Wednesday, June 17, 2015 at 3:21:32 PM UTC-4, Jason P. wrote: Hello Python community. I come from a classic background in what refers to OOP. Mostly Java and PHP ( 5.3). I'm used to abstract classes,

Re: Documenting a function signature (was: Set a flag on the function or a global?)

2015-06-18 Thread random832
On Wed, Jun 17, 2015, at 20:14, Chris Angelico wrote: Mostly. That would imply that object is a mandatory parameter, which AIUI isn't the case for Steven's edir. The downside of this kind of signature is that it's hard to show the parameters that have unusual defaults (either sentinel objects

Re: Classic OOP in Python

2015-06-18 Thread Todd
On Thu, Jun 18, 2015 at 1:03 PM, Fabien fabien.mauss...@gmail.com wrote: On 06/17/2015 11:16 PM, sohcahto...@gmail.com wrote: You don't need interfaces with Python. Duck typing makes that all possible. Yes, but I also like interfaces (or in python: mimicked interfaces with

Re: Classic OOP in Python

2015-06-18 Thread Jason P.
El miércoles, 17 de junio de 2015, 21:44:51 (UTC+2), Ned Batchelder escribió: On Wednesday, June 17, 2015 at 3:21:32 PM UTC-4, Jason P. wrote: Hello Python community. I come from a classic background in what refers to OOP. Mostly Java and PHP ( 5.3). I'm used to abstract classes,

Re: Classic OOP in Python

2015-06-18 Thread Marko Rauhamaa
Todd toddr...@gmail.com: On Thu, Jun 18, 2015 at 1:03 PM, Fabien fabien.mauss...@gmail.com wrote: Would you consider the following kind of program unpythonic? class MovingObject(object): Great doc about what a moving object is def move(self): Great doc about move

[issue24465] Make tar files created by shutil.make_archive() have deterministic sorting

2015-06-18 Thread Sam Thursfield
Changes by Sam Thursfield sam.thursfi...@codethink.co.uk: -- keywords: +patch Added file: http://bugs.python.org/file39728/tarfile-stable-ordering.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24465

[issue24465] Make tarfile have deterministic sorting

2015-06-18 Thread R. David Murray
R. David Murray added the comment: This would go beyond what the tar command itself does. I'm not sure we want to do that, as we are pretty much modeling our behavior on tar. However, that doesn't automatically mean we can't do it. We'll see what other people think. Personally I'm -0.

[issue24464] Got warning when compiling sqlite3 module on Mac OSX

2015-06-18 Thread Vajrasky Kok
New submission from Vajrasky Kok: I got this warning when compiling sqlite3 module. gcc -Wno-unused-result -Wsign-compare -g -O0 -Wall -Wstrict-prototypes -Werror=declaration-after-statement -DMODULE_NAME=sqlite3 -DSQLITE_OMIT_LOAD_EXTENSION=1 -IModules/_sqlite -I/usr/include -I./Include -I.

Re: Classic OOP in Python

2015-06-18 Thread Jason P.
El miércoles, 17 de junio de 2015, 22:39:31 (UTC+2), Marko Rauhamaa escribió: Ned Batchelder n...@nedbatchelder.com: TDD is about writing tests as a way to design the best system, and putting testing at the center of your development workflow. It works great with Python even without

Re: Classic OOP in Python

2015-06-18 Thread Ned Batchelder
On Thursday, June 18, 2015 at 7:21:29 AM UTC-4, Jason P. wrote: El miércoles, 17 de junio de 2015, 21:44:51 (UTC+2), Ned Batchelder escribió: On Wednesday, June 17, 2015 at 3:21:32 PM UTC-4, Jason P. wrote: Hello Python community. I come from a classic background in what refers to

Re: Posting gzip'd image file - server says Malformed Upload?

2015-06-18 Thread random832
On Wed, Jun 17, 2015, at 20:23, Chris Angelico wrote: On Thu, Jun 18, 2015 at 7:55 AM, Paul Hubert phbr...@gmail.com wrote: f_in = open(dafile, 'rb') f_out = gzip.open('/Users/Paul/Desktop/scripts/pic.jpg.gz', 'wb') f_out.writelines(f_in) f_out.close() f_in.close() Are you sure you

[issue24465] Make tar files created by shutil.make_archive() have deterministic sorting

2015-06-18 Thread Sam Thursfield
New submission from Sam Thursfield: I want shutil.make_archive() to produce deterministic output when given identical data as inputs. Right now there are two holes in this. One is that mtimes might not match. This can be fixed by the caller. The second is that the order that files in a

Re: ctypes and byte order

2015-06-18 Thread Peter Otten
Jean-Michel Pichavant wrote: - Original Message - From: Peter Otten __pete...@web.de becomes $ cat be2.py import ctypes, sys iarray_be = ctypes.c_uint32.__ctype_be__*5 class Foo_be(ctypes.BigEndianStructure): _fields_ = [('bar', iarray_be)] print sys.version f_be

Re: ctypes and byte order

2015-06-18 Thread Jean-Michel Pichavant
- Original Message - From: Peter Otten __pete...@web.de becomes $ cat be2.py import ctypes, sys iarray_be = ctypes.c_uint32.__ctype_be__*5 class Foo_be(ctypes.BigEndianStructure): _fields_ = [('bar', iarray_be)] print sys.version f_be = Foo_be((0,1,2,3,0x11223344))

Re: help in understanding the stackless code

2015-06-18 Thread MRAB
On 2015-06-18 08:41, ravi wrote: hi, I am new to python and need to know why the calling of switch(1) invokes the function listen twice in the below program? import stackless class EventHandler: def __init__(self,*outputs): if outputs==None: self.outputs=[]

thinking with laziness

2015-06-18 Thread Neal Becker
http://begriffs.com/posts/2015-06-17-thinking-with-laziness.html -- https://mail.python.org/mailman/listinfo/python-list

[issue24463] Python 3.4 bugs

2015-06-18 Thread Skip Montanaro
Skip Montanaro added the comment: Not a bug. The two elements of w are references to the same list: w = [[0] * 2] * 2 w [[0, 0], [0, 0]] [id(elt) for elt in w] [21743952, 21743952] -- nosy: +skip.montanaro resolution: - not a bug status: open - closed

Re: Classic OOP in Python

2015-06-18 Thread Chris Angelico
On Thu, Jun 18, 2015 at 9:03 PM, Fabien fabien.mauss...@gmail.com wrote: Would you consider the following kind of program unpythonic? class MovingObject(object): Great doc about what a moving object is def move(self): Great doc about move raise NotImplementedError()

[issue24465] Make tarfile have deterministic sorting

2015-06-18 Thread Lars Gustäbel
Lars Gustäbel added the comment: You don't need to patch the tarfile module. You could use os.walk() in shutil._make_tarball() and add each file with TarFile.add(recursive=False). -- nosy: +lars.gustaebel ___ Python tracker rep...@bugs.python.org

[issue24450] Add gi_yieldfrom calculated property to generator object

2015-06-18 Thread Benno Leslie
Benno Leslie added the comment: I've tried to address all the issues raised in the review of the first patch. -- Added file: http://bugs.python.org/file39725/gi_yieldfrom.v1.patch ___ Python tracker rep...@bugs.python.org

Re: Classic OOP in Python

2015-06-18 Thread Fabien
On 06/17/2015 11:16 PM, sohcahto...@gmail.com wrote: You don't need interfaces with Python. Duck typing makes that all possible. Yes, but I also like interfaces (or in python: mimicked interfaces with NotImplementedError) for their clarity and documentation purposes. Would you consider the

Re: Posting gzip'd image file - server says Malformed Upload?

2015-06-18 Thread Chris Angelico
On Thu, Jun 18, 2015 at 10:38 PM, random...@fastmail.us wrote: On Wed, Jun 17, 2015, at 20:23, Chris Angelico wrote: On Thu, Jun 18, 2015 at 7:55 AM, Paul Hubert phbr...@gmail.com wrote: f_in = open(dafile, 'rb') f_out = gzip.open('/Users/Paul/Desktop/scripts/pic.jpg.gz', 'wb')

Re: Classic OOP in Python

2015-06-18 Thread Cousin Stanley
python -m doctest application.py And from there, I would build up extra doc tests An extra doc test that fails #!/usr/bin/env python NewsGroup comp.lang.python Subject .. Classic OOP in Python Date . 2015-06-17 Post_By ..

[issue19542] WeakValueDictionary bug in setdefault()pop()

2015-06-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Yes, we need to fix this. Sorry for being a bit slow. -- versions: +Python 3.5, Python 3.6 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19542

Re: Time saving tips for Pythonists

2015-06-18 Thread John Strick
On Thursday, June 18, 2015 at 6:11:11 AM UTC-4, Productivi .co wrote: What are your best time saving tips when programming Python? PyCharm! -- https://mail.python.org/mailman/listinfo/python-list

[issue24466] extend_path explanation in documentation is ambiguous

2015-06-18 Thread alanf
New submission from alanf: The description of pkgutil.extend_path in the doc (e.g., https://docs.python.org/2/library/pkgutil.html , https://docs.python.org/3/library/pkgutil.html ) is so ambiguous that I had to run a test to understand its behavior. The doc says: This will add to the

[issue24465] Make tarfile have deterministic sorting

2015-06-18 Thread Sam Thursfield
Sam Thursfield added the comment: Thanks for the comments! Would you be happy for the patch to be merged if it was implemented by modifying shutil.make_archive() instead? I will rework it if so. -- ___ Python tracker rep...@bugs.python.org

Re: thinking with laziness

2015-06-18 Thread Steven D'Aprano
On Thu, 18 Jun 2015 11:10 pm, Neal Becker wrote: http://begriffs.com/posts/2015-06-17-thinking-with-laziness.html I wanted to think about that post, but I'm too lazy to read it. My-apologies-I-couldn't-resist-it-ly y'rs, -- Steven -- https://mail.python.org/mailman/listinfo/python-list

[issue19542] WeakValueDictionary bug in setdefault()pop()

2015-06-18 Thread Tin Tvrtković
Tin Tvrtković added the comment: We're actually getting bitten by this in production through the Riak Python client, so this isn't a strictly theoretical problem. -- nosy: +tinchester ___ Python tracker rep...@bugs.python.org

[issue24465] Make tarfile have deterministic sorting

2015-06-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't see any downside for this simple patch and think there is some merit for wanting a reproducible archive. -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24465

executable egg?

2015-06-18 Thread dmaziuk
Hi all, Here's my directory structure: myegg/ pkg1/ __init__.py ... pkg2/ __init__.py ... pkg3/ __init__.py ... setup.py I can make an egg with python setup.py bdist_egg and it works just fine. I'd like to make it executable with

[issue24419] In argparse action append_const doesn't work for positional arguments

2015-06-18 Thread paul j3
paul j3 added the comment: You can give the positional any custom name (the first parameter). You just can't reuse it (by giving 2 positionals the same name). And if you don't like what the 'help' shows, you can set the 'metavar'. That way only you see the positional's name. The name of a

[issue19235] Add a dedicated subclass for recursion errors

2015-06-18 Thread Elazar Gershuni
Elazar Gershuni added the comment: So what holds it back now? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19235 ___ ___ Python-bugs-list

[issue23255] SimpleHTTPRequestHandler refactor for more extensible usage.

2015-06-18 Thread Ent
Ent added the comment: Thanks Ned Berker, I can only imagine the amount of work the core devs have to deal with. Hope my patch makes it through in next version. Regards, Ent -- ___ Python tracker rep...@bugs.python.org

Re: thinking with laziness

2015-06-18 Thread Mark Lawrence
On 18/06/2015 14:53, Steven D'Aprano wrote: On Thu, 18 Jun 2015 11:10 pm, Neal Becker wrote: http://begriffs.com/posts/2015-06-17-thinking-with-laziness.html I wanted to think about that post, but I'm too lazy to read it. My-apologies-I-couldn't-resist-it-ly y'rs, Reminds me of last

Re: thinking with laziness

2015-06-18 Thread Chris Angelico
On Fri, Jun 19, 2015 at 2:15 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: Reminds me of last night's AGM of the Apathy Society, which was an outstanding success as nobody turned up. How do you know for sure? Nobody bothered to take minutes. ChrisA --

Re: ctypes and byte order

2015-06-18 Thread Terry Reedy
On 6/18/2015 5:39 AM, Jean-Michel Pichavant wrote: I'm currently writing python code that writes a small binary file to be used by another device which code is written in C. The python code runs on a little endian CPU, and unfortunately, the other device is using a big endian MIPS. The struct

Re: Documenting a function signature

2015-06-18 Thread Ben Finney
Laura Creighton l...@openend.se writes: In a message of Thu, 18 Jun 2015 10:04:46 +1000, Ben Finney writes: Since the introduction of keyword-only arguments in Python functions, the question arises of how to communicate this in documentation. I suppose it is way too late to scream I hate

Re: Python File as the Default PDF handler for Windows

2015-06-18 Thread Chris Angelico
On Fri, Jun 19, 2015 at 11:39 AM, MRAB pyt...@mrabarnett.plus.com wrote: I don't think it should be %s, but %*. Thanks, it's been a while since I fiddled with Windows associations. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Keypress Input

2015-06-18 Thread Christian Gollwitzer
Am 15.06.15 um 07:15 schrieb John McKenzie: from Tkinter import * from blinkstick import blinkstick led = blinkstick.find_first() timered = 0 timeyellow = 0 timeblue = 0 colour = None root = Tk() root.title('eFlag 1') def red1(event): colour = 1 def yellow1(event): colour = 2

JSON Object to CSV File Troubleshooting

2015-06-18 Thread Sahlusar
Good Evening, I have a conundrum regarding JSON objects and converting them to CSV: Context I am converting XML files to a JSON object (please see snippet below) and then finally producing a CSV file. Here is a an example JSON object: PAC: {

[issue24468] Expose compiler flag constants as code object attributes

2015-06-18 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- dependencies: +Awaitable ABC incompatible with functools.singledispatch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24468 ___

[issue24468] Expose compiler flag constants as code object attributes

2015-06-18 Thread Nick Coghlan
New submission from Nick Coghlan: As part of the PEP 492 implementation, Yury has needed to hardcode compile flag contants in various places, with adjacent comments explaining what the magic numbers mean. It occurred to me that there's a way we could make those constants readily available to

[issue23883] __all__ lists are incomplete

2015-06-18 Thread Jacek Kołodziej
Jacek Kołodziej added the comment: ftplib and threading have more functions I've meant function and exceptions, of course. Sorry for the noise. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23883

Re: Python File as the Default PDF handler for Windows

2015-06-18 Thread Naftali
On Thursday, June 18, 2015 at 5:05:15 PM UTC-4, Naftali wrote: Long time lurker. I'm looking to register a python script as the default pdf reader for windows. I assume I can just register the .py in the section windows section for registering default handlers, but I'm wondering how to

Re: Python File as the Default PDF handler for Windows

2015-06-18 Thread MRAB
On 2015-06-19 02:18, Chris Angelico wrote: On Fri, Jun 19, 2015 at 11:03 AM, Naftali nmichalow...@gmail.com wrote: I may be missing something in your reply, but I am *not* wondering how to associate python with the .pdf file extension. That I know how to do. What I want to know is how from

[issue24468] Expose compiler flag constants as code object attributes

2015-06-18 Thread Nick Coghlan
Nick Coghlan added the comment: In my last set of review comments on issue 24400 I suggested changing the Python level attributes for coroutine objects to cr_frame, cr_code, and cr_running. It's possible that may provide a different way to eliminate some of the current compiler flag checks.

[issue24468] Expose compiler flag constants as code object attributes

2015-06-18 Thread Larry Hastings
Larry Hastings added the comment: Probably, though I want to see a sample implementation before I agree to anything. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24468 ___

[issue24400] Awaitable ABC incompatible with functools.singledispatch

2015-06-18 Thread Nick Coghlan
Nick Coghlan added the comment: In my last set of review comments, I suggested changing the Python level attributes for coroutine objects to cr_frame, cr_code, and cr_running. That reminded me that now that coroutines are their own type, we should also give them their own state introspection

[issue23883] __all__ lists are incomplete

2015-06-18 Thread Jacek Kołodziej
Changes by Jacek Kołodziej kolodzi...@gmail.com: Added file: http://bugs.python.org/file39734/Issue23883_test_gettext.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23883 ___

Re: Python File as the Default PDF handler for Windows

2015-06-18 Thread Chris Angelico
On Fri, Jun 19, 2015 at 11:03 AM, Naftali nmichalow...@gmail.com wrote: I may be missing something in your reply, but I am *not* wondering how to associate python with the .pdf file extension. That I know how to do. What I want to know is how from within the program that I've told windows to

[issue24450] Add gi_yieldfrom calculated property to generator object

2015-06-18 Thread Nick Coghlan
Nick Coghlan added the comment: Marking this as dependent on issue 24400, as that refactors the PEP 492 implementation to make coroutines their own type (albeit one that shares a memory layout and some attribute names with generators at the C layer). I'd suggest cr_await as the calculated

Re: Why this list of dictionaries doesn't work?

2015-06-18 Thread Steven D'Aprano
On Fri, 19 Jun 2015 03:57 am, Gilcan Machado wrote: Hi, I'm trying to write a list of dictionaries like: people = ( {'name':'john', 'age':12} , {'name':'kacey', 'age':18} ) I've thought the code below would do the task. Why don't you just use exactly what you

Re: Python File as the Default PDF handler for Windows

2015-06-18 Thread Naftali
On Thursday, June 18, 2015 at 5:05:15 PM UTC-4, Naftali wrote: Long time lurker. I'm looking to register a python script as the default pdf reader for windows. I assume I can just register the .py in the section windows section for registering default handlers, but I'm wondering how to

[issue23883] __all__ lists are incomplete

2015-06-18 Thread Jacek Kołodziej
Jacek Kołodziej added the comment: Thank you for feedback, Martin. I've amended the the patch. Next, I've prepared some initial test.support.check__all__ helper, based on generalization of all previous patches. Its name/params' descriptions may be a bit rough - amendments/suggestions for such

Re: JSON Object to CSV Question

2015-06-18 Thread Steve Hayes
On Wed, 17 Jun 2015 17:49:35 -0400, Saran Ahluwalia ahlusar.ahluwa...@gmail.com wrote: Good Evening Everyone: I would like to have this JSON object written out to a CSV file so that the You've already said that in another thread, and got several answers. What are you? Some kind of troll? --

Re: JSON Object to CSV File Troubleshooting

2015-06-18 Thread Steve Hayes
On Thu, 18 Jun 2015 18:47:30 -0700 (PDT), Sahlusar ahlusar.ahluwa...@gmail.com wrote: Good Evening, I have a conundrum regarding JSON objects and converting them to CSV: That's the THIRD time you've asked this, in three separate threads. Why don't you read the answers you were given the first

[issue24400] Awaitable ABC incompatible with functools.singledispatch

2015-06-18 Thread Yury Selivanov
Yury Selivanov added the comment: Another iteration of the patch is attached. Nick, I think it's ready for your review. -- stage: needs patch - patch review type: - enhancement Added file: http://bugs.python.org/file39729/corotype.patch ___ Python

Re: Why this list of dictionaries doesn't work?

2015-06-18 Thread MRAB
On 2015-06-18 18:57, Gilcan Machado wrote: Hi, I'm trying to write a list of dictionaries like: people = ( {'name':'john', 'age':12} , {'name':'kacey', 'age':18} ) That's not a list; it's a tuple. If you want a list, use '[' and ']'. I've thought the code below

[issue24429] msvcrt error when embedded

2015-06-18 Thread eryksun
eryksun added the comment: shapely's installation instructions from windows are to use chris gohlke's prebuilt binaries from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/ Christoph Gohlke's Shapely‑1.5.9‑cp27‑none‑win_amd64.whl includes a version of geos_c.dll that has the VC90

Re: CLI Arguments That Call Functions?

2015-06-18 Thread Ian Kelly
On Thu, Jun 18, 2015 at 11:56 AM, Tony the Tiger tony@tiger.invalid wrote: I would have assumed there would be something built in to the ArgumentParser, but I can't detect anything that seems to do what I want, so I wrote the following: [SNIP] So, is there something already in the Python

Re: CLI Arguments That Call Functions?

2015-06-18 Thread Michael Torrie
On 06/18/2015 12:08 PM, Tony the Tiger wrote: Forgot to add, I don't read or see anything posted from outside of the groups. Posting from the mailing list here. I assume the nntp gateway is two-way. Unless you're manually blocking message originating in google groups, I don't see why you

Why this list of dictionaries doesn't work?

2015-06-18 Thread Gilcan Machado
Hi, I'm trying to write a list of dictionaries like: people = ( {'name':'john', 'age':12} , {'name':'kacey', 'age':18} ) I've thought the code below would do the task. But it doesn't work. And if I print(people) what I get is not the organize data structure like above.

python program without stackless.run()

2015-06-18 Thread ravi
Hi, I could not understand how the below program executes function fun without calling stackless.run() in the program? Here fun runs as a tasklet and as per my knowledge for that stackless.run() is must. - import stackless

how to dump tasklets status in python

2015-06-18 Thread ravi
hi, I have a complex python program running 100 tasklets simultaneously. I want to take dump of all the running tasklets including their current status and back trace at the time of exception. Can any one let me know how can this be done ? Thanks, ravi --

[issue19235] Add a dedicated subclass for recursion errors

2015-06-18 Thread Elazar Gershuni
Elazar Gershuni added the comment: Well that's a déjà vu. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19235 ___ ___ Python-bugs-list mailing

[issue24419] In argparse action append_const doesn't work for positional arguments

2015-06-18 Thread py.user
py.user added the comment: paul j3 wrote: You can give the positional any custom name (the first parameter). The dest argument is not required for giving name for an optional. You can either make it automatically or set by dest, it's handy and clear. import argparse parser =

[issue19235] Add a dedicated subclass for recursion errors

2015-06-18 Thread Yury Selivanov
Yury Selivanov added the comment: +1. This, unfortunately, can't go in 3.5 (too late), but I can commit this in 3.6. -- assignee: - yselivanov nosy: +yselivanov versions: +Python 3.6 -Python 3.5 ___ Python tracker rep...@bugs.python.org

Re: help in understanding the stackless code

2015-06-18 Thread ravi
yes It has instance of both Reporter and Switch. moreover I could not get why instance reporter is passed to class Switch as a parameter ? reporter = Reporter() switch = Switch(0,reporter) switch(1) thanks On Thursday, June 18, 2015 at 5:45:08 PM UTC+5:30, MRAB wrote:

[issue19235] Add a dedicated subclass for recursion errors

2015-06-18 Thread Yury Selivanov
Yury Selivanov added the comment: Larry, is there any chance this can be committed in 3.5 (the change is fully backwards compatible)? -- nosy: +larry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19235

Re: thinking with laziness

2015-06-18 Thread Todd
On Thu, Jun 18, 2015 at 6:15 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 18/06/2015 14:53, Steven D'Aprano wrote: On Thu, 18 Jun 2015 11:10 pm, Neal Becker wrote: http://begriffs.com/posts/2015-06-17-thinking-with-laziness.html I wanted to think about that post, but I'm too lazy

Re: Why this list of dictionaries doesn't work?

2015-06-18 Thread Gary Herron
On 06/18/2015 10:57 AM, Gilcan Machado wrote: Hi, I'm trying to write a list of dictionaries like: people = ( {'name':'john', 'age':12} , {'name':'kacey', 'age':18} ) I've thought the code below would do the task. But it doesn't work. Never say it doesn't work on

[issue24419] In argparse action append_const doesn't work for positional arguments

2015-06-18 Thread paul j3
paul j3 added the comment: (Important correction at the end of this post) The test that you are complaining about occurs at the start of the 'add_argument' method: def add_argument(self, *args, **kwargs): add_argument(dest, ..., name=value, ...)

Python File as the Default PDF handler for Windows

2015-06-18 Thread Naftali
Long time lurker. I'm looking to register a python script as the default pdf reader for windows. I assume I can just register the .py in the section windows section for registering default handlers, but I'm wondering how to access the file from within the program. The issue is this: We

Re: python program without stackless.run()

2015-06-18 Thread ravi
On Friday, June 19, 2015 at 1:41:36 AM UTC+5:30, Ian wrote: On Thu, Jun 18, 2015 at 1:47 PM, ravi temp@gmail.com wrote: I could not understand how the below program executes function fun without calling stackless.run() in the program? Here fun runs as a tasklet and as per my

Reassigning keys in dictionary of lists and then writing out to CSV file?

2015-06-18 Thread Sahlusar
I am currently attempting to work on converting a fairly sizeable JSON object and convert it into a CSV format. However, when I attempt to do so, using a conventional approach (that seems to work with other files). I am presented with a ValueError: too many values to unpack I have tried to

[issue24429] msvcrt error when embedded

2015-06-18 Thread Steve Dower
Steve Dower added the comment: Steve, since you haven't closed this issue, have you considered my suggestion to export _Py_ActivateActCtx and _Py_DeactivateActCtx for use by C extensions such as _ctypes.pyd? These functions are better than manually creating a context from the manifest

[issue24400] Awaitable ABC incompatible with functools.singledispatch

2015-06-18 Thread Yury Selivanov
Changes by Yury Selivanov yseliva...@gmail.com: Added file: http://bugs.python.org/file39730/corotype.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24400 ___

Re: Keypress Input

2015-06-18 Thread Michael Torrie
On 06/18/2015 01:35 PM, Oscar Benjamin wrote: I use the following. I found in testing that when you push the button it prints 'Button pressed' 10 times a second (in actual use it calls poweroff so I guess bounce isn't an issue there). Is there some reason it needs to be cleverer in this case?

Re: Keypress Input

2015-06-18 Thread Oscar Benjamin
On Wed, 17 Jun 2015 at 02:23 Michael Torrie torr...@gmail.com wrote: On 06/16/2015 02:49 PM, Grant Edwards wrote: On 2015-06-16, John McKenzie dav...@bellaliant.net wrote: It never occurred to me something so simple as keystrokes would not be present in Python, a language rated as being

[issue6839] zipfile can't extract file

2015-06-18 Thread Sean Goodwin
Changes by Sean Goodwin sean.e.good...@gmail.com: -- nosy: +Sean Goodwin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6839 ___ ___

Re: python program without stackless.run()

2015-06-18 Thread Ian Kelly
On Thu, Jun 18, 2015 at 1:47 PM, ravi temp@gmail.com wrote: I could not understand how the below program executes function fun without calling stackless.run() in the program? Here fun runs as a tasklet and as per my knowledge for that stackless.run() is must. You seem to have a lot of

Re: Documenting a function signature (was: Set a flag on the function or a global?)

2015-06-18 Thread Laura Creighton
In a message of Thu, 18 Jun 2015 10:04:46 +1000, Ben Finney writes: Since the introduction of keyword-only arguments in Python functions, the question arises of how to communicate this in documentation. I suppose it is way too late to scream I hate keyword-only arguments! The lone asterisk

Re: Posting gzip'd image file - server says Malformed Upload?

2015-06-18 Thread Laura Creighton
I got to this party late. One way to get the malformed upload message is is you gzip something that already is gzipped, and send that up the pipe. worth checking. Laura -- https://mail.python.org/mailman/listinfo/python-list

Re: Hotspot Locater

2015-06-18 Thread Laura Creighton
yes. wifi https://wifi.readthedocs.org/en/latest/ see this answer, not raspberry pi specific http://stackoverflow.com/questions/20470626/python-script-for-raspberrypi-to-connect-wifi-automatically but is linux specific, what OS do you need? Laura --

Re: help in understanding the stackless code

2015-06-18 Thread Laura Creighton
You need to send your message over here. http://www.stackless.com/mailman/listinfo/stackless I think I know the answer, from my work in duplicating stackless for greenlets in pypy. But that's the answer in theory. In practice, you need real stackless users. Laura --

Re: Classic OOP in Python

2015-06-18 Thread Laura Creighton
In a message of Thu, 18 Jun 2015 11:50:28 +0100, Mark Lawrence writes: Throw in http://clonedigger.sourceforge.net/ as well and you've a really awesome combination. Mark Lawrence I didn't know about that one. Hey thank you, Mark. Looks great. It needs its own entry in

Re: Python File as the Default PDF handler for Windows

2015-06-18 Thread Chris Angelico
On Fri, Jun 19, 2015 at 7:04 AM, Naftali nmichalow...@gmail.com wrote: What I want to do is write a pdf handler to handle windows open instruction. In the script I would run a command line pdf unlocker on the file and open the unlocked file with adobe (or the like). I've googled and though

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-06-18 Thread Martin Panter
Martin Panter added the comment: FWIW there is a new message currently being triggered by test___all__. The patch here also stops this message. $ hg update 4335d898be59 $ ./python -bWall -m test test___all__ [1/1] test___all__ Warning -- warnings.filters was modified by test___all__ 1 test

Hotspot Locater

2015-06-18 Thread admin.dslcomputer
Hi everyone: There is interest in our group in the development of Python code to locate WiFi hotspots. My question: Is there a Python solution in the location of WiFi hotspots? Hal-- https://mail.python.org/mailman/listinfo/python-list

[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS (update: and NetBSD w/ FFS, Solaris w/ UFS)

2015-06-18 Thread Martin Panter
Martin Panter added the comment: The commit causes test_os to emit DeprecationWarning warnings, which it didn’t before: [vadmium@localhost cpython]$ hg update 4335d898be59 0 files updated, 0 files merged, 0 files removed, 0 files unresolved [vadmium@localhost cpython]$ ./python -bWdefault -m

Get off the list

2015-06-18 Thread Deogratius Musiige
Hi, How can i get off this mailing list? Best regards / Med venlig hilsen Deogratius Musiige Software Development Engineer Sennheiser Communications A/S Industriparken 27 DK-2750 Ballerup Direct +45 5618 0320 Mail d...@senncom.com Web

Re: JSON Object to CSV file

2015-06-18 Thread Sahlusar
On Wednesday, June 17, 2015 at 2:21:05 PM UTC-4, Peter Otten wrote: Sahlusar wrote: On Wednesday, June 17, 2015 at 11:00:24 AM UTC-4, Saran A wrote: I would like to have this JSON object written out to a CSV file so that the keys are header fields (for each of the columns) and the values

JSON Object to CSV Question

2015-06-18 Thread Saran Ahluwalia
Good Evening Everyone: I would like to have this JSON object written out to a CSV file so that the keys are header fields (for each of the columns) and the values are values that are associated with each header field. Is there a best practice for working with this? Ideally I would like to

Re: Get off the list

2015-06-18 Thread Cecil Westerhof
On Wednesday 17 Jun 2015 09:09 CEST, Deogratius Musiige wrote: How can i get off this mailing list? Looking at the headers: List-Unsubscribe: https://mail.python.org/mailman/options/python-list, mailto:python-list-requ...@python.org?subject=unsubscribe So I would send an email with

[issue23255] SimpleHTTPRequestHandler refactor for more extensible usage.

2015-06-18 Thread Berker Peksag
Berker Peksag added the comment: Ned is correct. I started to review the patch, but couldn't find time to do a complete review. I'll take a look at it in a week or two. Thanks! -- assignee: - berker.peksag ___ Python tracker rep...@bugs.python.org

Time saving tips for Pythonists

2015-06-18 Thread Productivi .co
Hello Pythonists! I'm preparing an article to show up at simplilearn.com about the best time saving tips Pyhonists use, and thus, conducting interviews with Pythonists like you. The interview question I would like to ask you is: *What are your best time saving tips when programming Python?*

Re: Get off the list

2015-06-18 Thread Cecil Westerhof
On Thursday 18 Jun 2015 09:36 CEST, Ian Kelly wrote: On Thu, Jun 18, 2015 at 1:05 AM, Cecil Westerhof ce...@decebal.nl wrote: On Wednesday 17 Jun 2015 09:09 CEST, Deogratius Musiige wrote: How can i get off this mailing list? Looking at the headers: List-Unsubscribe:

help in understanding the stackless code

2015-06-18 Thread ravi
hi, I am new to python and need to know why the calling of switch(1) invokes the function listen twice in the below program? import stackless class EventHandler: def __init__(self,*outputs): if outputs==None: self.outputs=[] else:

[issue24462] bytearray.find Buffer Over-read

2015-06-18 Thread DmitryJ
DmitryJ added the comment: Quick analysis tells this can be attributed to the following code (in 2.7): https://hg.python.org/cpython/file/a8e24d776e99/Objects/stringlib/fastsearch.h#l110 https://hg.python.org/cpython/file/a8e24d776e99/Objects/stringlib/fastsearch.h#l116 Suppose i = 0, then

  1   2   >