Raspberry model b -- program

2014-11-08 Thread gm
Hi ! I have one small program that should be completed till tomorrow so if someone can help am ready to pay this ( btw. budget for this is $40 ). Project: - usb scanner is connected to the PI. - when the user gets his e.g. coffe bill with barcode, he put this bill in from of scanner and

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-08-10 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: test_excinfo_no_python_sourcecode of py now passes. -- resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21591

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-08-10 Thread Dirkjan Ochtman
Dirkjan Ochtman added the comment: Thanks, Benjamin, for reverting the run-time bits. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21591 ___

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-08-10 Thread Nick Coghlan
Nick Coghlan added the comment: Given that our test suite missed the regression originally, it would be nice to have a test case that directly built an AST that relies on the runtime check. -- ___ Python tracker rep...@bugs.python.org

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-08-09 Thread Dirkjan Ochtman
Dirkjan Ochtman added the comment: I can take a look at the py failure next week. Keeping the run-time compatibility code seems sensible, but I'm not sure if it'd fix the py test? I don't think reverting the changes at this point is warranted. --

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-08-09 Thread Nick Coghlan
Nick Coghlan added the comment: Agreed reverting isn't necessary - main thing is to figure out what went wrong in the py test suite and come up with a new test case that covers it. The reason I suspect it's the missing runtime check that's causing the py problem is because (as far as I am

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-08-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0e9b023078e6 by Benjamin Peterson in branch '2.7': restore runtime exec test (#21591) http://hg.python.org/cpython/rev/0e9b023078e6 -- ___ Python tracker rep...@bugs.python.org

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-08-04 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: Commit 33fb5600e9a1 causes 1 test failure in test suite of py (https://pypi.python.org/pypi/py). Test suite of py requires pytest (https://pypi.python.org/pypi/pytest) The failing test (test_excinfo_no_python_sourcecode) requires Jinja

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-08-04 Thread Nick Coghlan
Nick Coghlan added the comment: I suspect there may also be a problem if executing pyc code generated the old way (this patch didn't bump the magic number, and doesn't really need to, so that case still needs to be handled). Restoring the runtime check should cover it (the test can craft a

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-07-30 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- stage: patch review - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21591 ___ ___

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-07-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 33fb5600e9a1 by Dirkjan Ochtman in branch '2.7': Issue #21591: Handle exec backwards compatibility in the AST builder. http://hg.python.org/cpython/rev/33fb5600e9a1 New changeset 6c47c6d2033e by Robert Jordens in branch '2.7': Issue #21591: add

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-07-29 Thread Dirkjan Ochtman
Dirkjan Ochtman added the comment: Thanks to Victor Stinner for the review! -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21591 ___

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-07-25 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21591 ___ ___ Python-bugs-list

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-07-24 Thread Dirkjan Ochtman
Dirkjan Ochtman added the comment: I came up with a patch that shifts the compatibility hack we have for the tuple form of exec from run-time (in exec_statement()) to the CST-to-AST transformation (in ast_for_exec_stmt()). It seems to pass the tests (including the ones Robert pasted in here).

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-07-24 Thread Dirkjan Ochtman
Dirkjan Ochtman added the comment: Oh, one specific question: I'm not sure if I should free the old expr1 (the top-level exec value) before overwriting it with the new one. -- ___ Python tracker rep...@bugs.python.org

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-07-23 Thread Dirkjan Ochtman
Changes by Dirkjan Ochtman dirk...@ochtman.nl: -- nosy: +djc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21591 ___ ___ Python-bugs-list mailing

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-07-22 Thread Guido van Rossum
Guido van Rossum added the comment: This does appear to be a bug. Please research the C code that originates the error message -- there's probably a simple logic mistake. -- nosy: +gvanrossum ___ Python tracker rep...@bugs.python.org

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-07-22 Thread Neil Muller
Neil Muller added the comment: Poking at the source of the error suggests the problem is in symtable.c: The offending logic looks to be (around line 1124 in python 2.7 at revision 91767:4cef7b0ec659): if (s-v.Exec.globals) { ... } else { st-st_cur-ste_unoptimized |= OPT_BARE_EXEC; }

[issue18016] subprocess should open stdin in mode w+b on windows

2014-07-15 Thread Steve Dower
Steve Dower added the comment: With 2.7 and 3.4 (same for 32- and 64-bit): f = open('test.bin', 'wb') f.write(b' ' * (1024*1024*100)) 104857600 f.close() import os os.stat('test.bin').st_size 104857600 The linked KB only applies to VS 2003 and VS 2005 (VC7 and VC8), so I'm not entirely

[issue18016] subprocess should open stdin in mode w+b on windows

2014-07-12 Thread Mark Lawrence
Mark Lawrence added the comment: @Jason I'm very sorry about the delay in getting back to you. Can our Windows gurus shed any light on this one? -- nosy: +BreamoreBoy, steve.dower, tim.golden, zach.ware type: - behavior versions: +Python 3.4, Python 3.5

[issue11681] -b option undocumented

2014-06-08 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11681 ___

[issue11681] -b option undocumented

2014-06-07 Thread Emily Zhao
Emily Zhao added the comment: Might be worth making this addition from 3 (I'm not sure how to add this to 2) -b : issue warnings about str(bytes_instance), str(bytearray_instance) and comparing bytes/bytearray with str. (-bb: issue errors) Building on Martin's example: On all

[issue11681] -b option undocumented

2014-06-07 Thread Emily Zhao
Emily Zhao added the comment: Here's an attempt (based on 3's main.c http://hg.python.org/cpython/file/8866ac6f2269/Modules/main.c) -- keywords: +patch Added file: http://bugs.python.org/file35528/issue11681.patch ___ Python tracker

[issue11681] -b option undocumented

2014-06-07 Thread Martin Panter
Martin Panter added the comment: Trouble is, in Python 2 bytes() and str() are the same thing, and most of those conditions don’t apply. Maybe something like this is more correct: -b : issue warnings about comparing bytearray with unicode. (-bb: issue errors

[issue20361] -W command line options and PYTHONWARNINGS environmental variable should not override -b / -bb command line options

2014-06-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: patch review - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20361 ___ ___

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-05-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: The exception appears to be intentional, though I do not know what a 'qualified' exec would be. But since the tuple form is intended to mimic 3.x exec, and since a reduced version of your example c = ''' def g(): def f(): if True:

[issue21591] exec(a, b, c) not the same as exec a in b, c in nested functions

2014-05-28 Thread Robert Jordens
New submission from Robert Jordens: According to the documentation the exec a in b, c is equivalent to exec(a, b, c). But in the testcase below the tuple form causes a SyntaxError while the statement form works fine. diff -r e770d8c4291c Lib/test/test_compile.py --- a/Lib/test

[issue20361] -W command line options and PYTHONWARNINGS environmental variable should not override -b / -bb command line options

2014-04-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch is a bit problematic, because Py_BytesWarningFlag may also be set by e.g. an application embedding Python, but then Python's main.c won't be executed. -- ___ Python tracker rep...@bugs.python.org

[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2014-04-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Serhiy, Gregory, Raymond, Antoine: so what is your feeling on this issue? Is it worth it? I don't think it is worth it. There may be some cases that benefit, but it adds extra branching code to the common cases (sets and dicts) that already have the

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset dc6c2ab7fec2 by Mark Dickinson in branch 'default': Issue #21193: Make (e.g.,) pow(2, -3, 5) raise ValueError rather than TypeError. Patch by Josh Rosenberg. http://hg.python.org/cpython/rev/dc6c2ab7fec2 -- nosy: +python-dev

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-11 Thread Mark Dickinson
Mark Dickinson added the comment: Patch applied. Thanks, all. -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21193

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset a8f3ca72f703 by Benjamin Peterson in branch 'default': test the change of #21193 correctly http://hg.python.org/cpython/rev/a8f3ca72f703 -- ___ Python tracker rep...@bugs.python.org

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-11 Thread Mark Dickinson
Mark Dickinson added the comment: Benjamin: thanks for the fix. To be clear: Josh Rosenberg's patch had the correct test change. It was the (poorly) trained monkey who made the commit who broke the test. Sorry, all. -- ___ Python tracker

Re: how to make [a,b,[c,d],e] into ['a', 'b', 'c', 'd', 'e'] ?

2014-04-10 Thread Boris Borcic
Rustom Mody wrote: def fl1(l): return [y for x in l for y in x] # recursive flatten def fr(l): ... if not isinstance(l,list): return [l] ... return fl1([fr(x) for x in l]) For a short non-recursive procedure - not a function, modifies L in-place but none of its sublists. def

Re: how to make [a,b,[c,d],e] into ['a', 'b', 'c', 'd', 'e'] ?

2014-04-10 Thread Boris Borcic
Boris Borcic wrote: Rustom Mody wrote: def fl1(l): return [y for x in l for y in x] # recursive flatten def fr(l): ... if not isinstance(l,list): return [l] ... return fl1([fr(x) for x in l]) For a short non-recursive procedure - not a function, modifies L in-place but none of its

Re: how to make [a,b,[c,d],e] into ['a', 'b', 'c', 'd', 'e'] ?

2014-04-10 Thread pete . bee . emm
wrote: x=[a,b,[c,d],e] y=x[2] y ['c', 'd'] x.insert(2,y[0]) x ['a', 'b', 'c', ['c', 'd'], 'e'] x.insert(3,y[1]) x ['a', 'b', 'c', 'd', ['c', 'd'], 'e'] del x[4] x ['a', 'b', 'c', 'd', 'e'] maybe there is a more smart way to do. -- https://mail.python.org/mailman/listinfo

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-10 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- assignee: - mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21193 ___ ___

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-10 Thread Mark Dickinson
Mark Dickinson added the comment: I was wondering how the TypeError got there in the first place. Diving into the history is instructive: changeset cdfdd5359411 modified the exception message: taniyama:cpython mdickinson$ hg log -r19719 changeset: 19719:cdfdd5359411 branch:

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-10 Thread Josh Rosenberg
Josh Rosenberg added the comment: Agreed that there is no need to patch 2.7/3.4; this is a pedantic correctness fix, not a serious bug. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21193

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: +1 for ValueError as well. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21193 ___ ___

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-10 Thread Tim Peters
Tim Peters added the comment: Yup, agreed with all: ValueError makes a lot more sense, but the change shouldn't be backported. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21193 ___

how to make [a,b,[c,d],e] into ['a', 'b', 'c', 'd', 'e'] ?

2014-04-09 Thread length power
x=[a,b,[c,d],e] y=x[2] y ['c', 'd'] x.insert(2,y[0]) x ['a', 'b', 'c', ['c', 'd'], 'e'] x.insert(3,y[1]) x ['a', 'b', 'c', 'd', ['c', 'd'], 'e'] del x[4] x ['a', 'b', 'c', 'd', 'e'] maybe there is a more smart way to do. -- https://mail.python.org/mailman/listinfo/python-list

Re: how to make [a, b, [c, d], e] into ['a', 'b', 'c', 'd', 'e'] ?

2014-04-09 Thread Ben Finney
length power elearn2...@gmail.com writes: maybe there is a more smart way to do. Maybe. But a way to do what, exactly? You start with a list, but what is it exactly that you want to do with that list? x = [a, b, [c, d], e] If I interpret your request *literally*, I can achieve

Re: how to make [a,b,[c,d],e] into ['a', 'b', 'c', 'd', 'e'] ?

2014-04-09 Thread balaji marisetti
There was long thread discussing flattening of a list on this list :). See the link below. https://mail.python.org/pipermail/python-list/2014-March/669256.html On 10 April 2014 10:44, length power elearn2...@gmail.com wrote: x=[a,b,[c,d],e] y=x[2] y ['c', 'd'] x.insert(2,y[0]) x ['a', 'b

Re: how to make [a,b,[c,d],e] into ['a', 'b', 'c', 'd', 'e'] ?

2014-04-09 Thread Rustom Mody
On Thursday, April 10, 2014 10:55:10 AM UTC+5:30, balaji marisetti wrote: There was long thread discussing flattening of a list on this list :). See the link below. I dont think that thread is relevant to this question: 1. That (started with) a strange/cute way of using names 2. It does not

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-09 Thread Josh Rosenberg
rely on this behavior. Related: #457066 -- components: Interpreter Core messages: 215860 nosy: josh.rosenberg priority: normal severity: normal status: open title: pow(a, b, c) should not raise TypeError when b is negative and c is provided type: behavior versions: Python 2.7, Python 3.1

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-09 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +mark.dickinson versions: -Python 3.1, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21193 ___

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-09 Thread Josh Rosenberg
Josh Rosenberg added the comment: Here's the trivial patch for code and the associated unit test (we were actually testing that it raised TypeError specifically; it now raises ValueError, and the unit test expects ValueError). unit tests passed aside from test_io, but I'm pretty sure that's

[issue21193] pow(a, b, c) should not raise TypeError when b is negative and c is provided

2014-04-09 Thread Josh Rosenberg
Josh Rosenberg added the comment: As I mentioned on another bug, I filled out and submitted the contributor agreement form electronically earlier this week, it just hasn't propagated yet. I'm fairly sure trained monkeys reading the description of this bug report would produce the exact same

[issue20361] -W command line options and PYTHONWARNINGS environmental variable should not override -b / -bb command line options

2014-04-03 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- nosy: -skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20361 ___ ___ Python-bugs-list

[issue20361] -W command line options and PYTHONWARNINGS environmental variable should not override -b / -bb command line options

2014-02-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Final patch should remove a workaround in Tools/scripts/run_tests.py. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20361 ___

[issue20361] -W command line options and PYTHONWARNINGS environmental variable should not override -b / -bb command line options

2014-02-15 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20361 ___ ___

[issue20361] -W command line options and PYTHONWARNINGS environmental variable should not override -b / -bb command line options

2014-02-10 Thread Jakub Wilk
Changes by Jakub Wilk jw...@jwilk.net: -- nosy: +jwilk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20361 ___ ___ Python-bugs-list mailing list

[issue20361] -W command line options and PYTHONWARNINGS environmental variable should not override -b / -bb command line options

2014-02-06 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20361 ___

[issue7938] makesetup interprets macros -DA=B as a Make variable definition

2014-02-03 Thread Mark Lawrence
Changes by Mark Lawrence breamore...@yahoo.co.uk: -- nosy: -BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7938 ___ ___

[issue20361] -W command line options and PYTHONWARNINGS environmental variable should not override -b / -bb command line options

2014-01-23 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20361 ___

[issue20361] -W command line options and PYTHONWARNINGS environmental variable should not override -b / -bb command line options

2014-01-23 Thread Arfrever Frehtes Taifersar Arahesis
New submission from Arfrever Frehtes Taifersar Arahesis: Currently -W command line options and PYTHONWARNINGS environmental variable non-intuitively override settings specified by -b / -bb command line options. $ python3.4 -c 'print( == b)' False $ python3.4 -b -c 'print( == b)' -c:1

[issue20361] -W command line options and PYTHONWARNINGS environmental variable should not override -b / -bb command line options

2014-01-23 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: By the way, Tools/scripts/run_tests.py (used by 'test' target in Makefile) passes '-W default -bb', which currently fails work as intended (i.e. treating BytesWarnings as errors). -- ___ Python

[issue20361] -W command line options and PYTHONWARNINGS environmental variable should not override -b / -bb command line options

2014-01-23 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- dependencies: +BytesWarnings triggerred by test suite ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20361 ___

[issue20340] -bb option does not have different behavior than -b option

2014-01-22 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20340 ___

[issue20340] -bb option does not have different behavior than -b option

2014-01-21 Thread Arfrever Frehtes Taifersar Arahesis
New submission from Arfrever Frehtes Taifersar Arahesis: -bb option does not have different behavior than -b option since Python 3.2. http://docs.python.org/3.4/using/cmdline.html#cmdoption-b says: Issue a warning when comparing str and bytes. Issue an error when the option is given twice (-bb

[issue11681] -b option undocumented

2014-01-04 Thread moijes12
Changes by moijes12 moije...@gmail.com: -- nosy: -moijes12 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11681 ___ ___ Python-bugs-list mailing

[issue11681] -b option undocumented

2014-01-04 Thread Martin Panter
Martin Panter added the comment: Try this to trigger a warning: python2 -b -c 'bytearray(3) == u3' -c:1: BytesWarning: Comparison between bytearray and string -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-12-16 Thread STINNER Victor
STINNER Victor added the comment: If it's hard to see a real speedup, it's probably not interesting to use the hash in string comparison. -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org

[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-11-12 Thread STINNER Victor
STINNER Victor added the comment: I ran pybench with the patch. I don't understand this result (10% slower with the patch): DictWithStringKeys:28ms25ms +10.7%28ms26ms +10.5% This test doesn't use unicode_compare_eq() from Objects/unicodeobject.c but unicode_eq() from

[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-11-12 Thread STINNER Victor
STINNER Victor added the comment: (oops, I didn't want to close the issue, it's a mistake) -- resolution: invalid - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16286

[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-11-07 Thread STINNER Victor
STINNER Victor added the comment: I added recently a new _PyUnicode_CompareWithId() function: changeset 77bebcf5c4cf (issue #19512). This function can be used instead of PyUnicode_CompareWithASCIIString() when the right parameter is a common string. It is interesting when the right string is

[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-11-07 Thread STINNER Victor
STINNER Victor added the comment: Serhiy, Gregory, Raymond, Antoine: so what is your feeling on this issue? Is it worth it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16286 ___

[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-11-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 536a7c09c7fd by Victor Stinner in branch 'default': Issue #16286: write a new subfunction bytes_compare_eq() http://hg.python.org/cpython/rev/536a7c09c7fd -- nosy: +python-dev ___ Python tracker

[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-11-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5fa291435740 by Victor Stinner in branch 'default': Issue #16286: optimize PyUnicode_RichCompare() for identical strings (same http://hg.python.org/cpython/rev/5fa291435740 -- ___ Python tracker

[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-11-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset da9c6e4ef301 by Victor Stinner in branch 'default': Issue #16286: remove duplicated identity check from unicode_compare() http://hg.python.org/cpython/rev/da9c6e4ef301 -- ___ Python tracker

[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-11-04 Thread STINNER Victor
STINNER Victor added the comment: I applied changes unrelated to the hash. -- Added file: http://bugs.python.org/file32493/compare_hash-3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16286

[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-11-04 Thread STINNER Victor
STINNER Victor added the comment: Results of benchmarks using compare_hash-3.patch: $ time ../benchmarks/perf.py -r -b default ./pythonorig ./pythonhash INFO:root:Skipping benchmark slowspitfire; not compatible with Python 3.4 INFO:root:Skipping benchmark slowpickle; not compatible with Python

[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-10-31 Thread STINNER Victor
STINNER Victor added the comment: Updated patch. -- Added file: http://bugs.python.org/file32445/compare_hash-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16286 ___

[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-10-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: That raises the question of what strings ever have had their hash already computed if the string hasn't been interned or has been used in a dict or set? Currently, none, I think. -- nosy: +pitrou ___ Python

[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-10-28 Thread STINNER Victor
STINNER Victor added the comment: That raises the question of what strings ever have had their hash already computed if the string hasn't been interned or has been used in a dict or set? Currently, none, I think. Strings are used (and compared) outside dict and set. --

[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-10-28 Thread STINNER Victor
STINNER Victor added the comment: Let's try to identify some use cases in the Python test suite using gdb: (gdb) b unicode_compare_eq (gdb) condition 1 ((PyASCIIObject*)str1)-hash != -1 ((PyASCIIObject*)str2)-hash != -1 ((PyASCIIObject*)str1)-hash != ((PyASCIIObject*)str2)-hash (gdb) run

[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-10-28 Thread STINNER Victor
STINNER Victor added the comment: (4) str in __all__ (list of str): os.py: if putenv not in __all__: __all__.append(putenv) For this example: putenv is probably interned by def putenv(...). putenv string and the name of the function are the same constant. When a function is

[issue8425] a -= b should be fast if a is a small set and b is a large set

2013-07-27 Thread Michele Orrù
Michele Orrù added the comment: ping. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8425 ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue8425] a -= b should be fast if a is a small set and b is a large set

2013-07-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: There's no rush on this. I have other work I want to do on set objects before applying further optimizations, so I want to hold off on it for a bit. -- ___ Python tracker rep...@bugs.python.org

[issue18263] python.man: no documentation for -b, -X

2013-06-19 Thread Jakub Wilk
New submission from Jakub Wilk: The -b and -X options are not documented in Misc/python.man. -- assignee: docs@python components: Documentation messages: 191463 nosy: docs@python, jwilk priority: normal severity: normal status: open title: python.man: no documentation for -b, -X

[issue18263] python.man: no documentation for -b, -X

2013-06-19 Thread R. David Murray
R. David Murray added the comment: I think we tend to forget that that page exists. Patches welcome. -- keywords: +easy nosy: +r.david.murray stage: - needs patch type: - behavior ___ Python tracker rep...@bugs.python.org

[issue18263] python.man: no documentation for -b, -X

2013-06-19 Thread Corey Brune
Corey Brune added the comment: Hello, I added the two options requested in python.man in the patch file created from hg diff python.man.patch. -- keywords: +patch nosy: +cbrune Added file: http://bugs.python.org/file30649/python.man.patch ___

[issue18263] python.man: no documentation for -b, -X

2013-06-19 Thread Senthil Kumaran
Senthil Kumaran added the comment: Thanks for the patch. Committed these changes in: changeset dfead0696a71 changeset e26b00adb7ba -- nosy: +orsenthil resolution: - fixed stage: needs patch - committed/rejected status: open - closed versions: +Python 3.3, Python 3.4

Help me with the script? How to find items in csv file A and not in file B and vice versa

2013-06-18 Thread Alan Newbie
Hello, Let's say I want to compare two csv files: file A and file B. They are both similarly built - the first column has product IDs (one product per row) and the columns provide some stats about the products such as sales in # and $. I want to compare these files - see which product IDs

Re: Help me with the script? How to find items in csv file A and not in file B and vice versa

2013-06-18 Thread Peter Otten
Alan Newbie wrote: Hello, Let's say I want to compare two csv files: file A and file B. They are both similarly built - the first column has product IDs (one product per row) and the columns provide some stats about the products such as sales in # and $. I want to compare these files

Re: Help me with the script? How to find items in csv file A and not in file B and vice versa

2013-06-18 Thread alonnirs
(Bfile.csv, rb) as g: b = {row[0] for row in csv.reader(g)} #create variables pointing to lists with unique product IDs in A and B respectively in_a_not_b = a-b in_b_not_a = b-a print in_a_not_b print in_b_not_a with open(inAnotB.csv, wb) as f: writer = csv.writer(f

Re: Help me with the script? How to find items in csv file A and not in file B and vice versa

2013-06-18 Thread Andreas Perstinger
alonn...@gmail.com wrote: and when I run it I get an invalid syntex error and (as a true newbie I used a GUI)in_a_not_b is highlighted in the with open(inAnotB.csv, wb) as f: writer = csv.writer(f) writer.writerows([item] for item in_a_not_b)

Re: Help me with the script? How to find items in csv file A and not in file B and vice versa

2013-06-18 Thread Alan Newbie
thanks a lot :) -- http://mail.python.org/mailman/listinfo/python-list

Re: python b'...' notation

2013-05-31 Thread jmfauth
to get it exactly the string I wanted.  I wanted, for example, b'\n\x00' to display as 0x0A 0x00 or b'!\xff(\xc0' to display as 0x21 0xFF 0x28 0xC0. a = b'!\xff(\xc0\n\x00' z = ['0x{:02X}'.format(c) for c in b] z ['0x21', '0xFF', '0x28', '0xC0', '0x0A', '0x00'] s = ' '.join(z) s

Re: python b'...' notation

2013-05-30 Thread alcyon
, for example, b'\n\x00' to display as 0x0A 0x00 or b'!\xff(\xc0' to display as 0x21 0xFF 0x28 0xC0. -- http://mail.python.org/mailman/listinfo/python-list

python b'...' notation

2013-05-29 Thread alcyon
This notation displays hex values except when they are 'printable', in which case it displays that printable character. How do I get it to force hex for all bytes? Thanks, Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: python b'...' notation

2013-05-29 Thread Ian Kelly
On Wed, May 29, 2013 at 12:33 PM, alcyon st...@terrafirma.us wrote: This notation displays hex values except when they are 'printable', in which case it displays that printable character. How do I get it to force hex for all bytes? Thanks, Steve Is this what you want? ''.join('%02x' % x

Re: python b'...' notation

2013-05-29 Thread Cameron Simpson
On 29May2013 13:14, Ian Kelly ian.g.ke...@gmail.com wrote: | On Wed, May 29, 2013 at 12:33 PM, alcyon st...@terrafirma.us wrote: | This notation displays hex values except when they are 'printable', in which case it displays that printable character. How do I get it to force hex for all bytes?

[issue18016] subprocess should open stdin in mode w+b on windows

2013-05-19 Thread Jason Gross
that uses mode 'wb') to use mode 'w+b', at least on Windows. -- components: Library (Lib) messages: 189624 nosy: Jason.Gross priority: normal severity: normal status: open title: subprocess should open stdin in mode w+b on windows versions: Python 2.7

[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-04-09 Thread STINNER Victor
STINNER Victor added the comment: I will benchmark the overhead of memcmp() on short strings. We may check the first and last characters before calling memcmp() to limit the overhead of calling a function. I created the issue #17628 for this point. --

[issue16286] Use hash if available to optimize a==b and a!=b for bytes and str

2013-04-07 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- title: Optimize a==b and a!=b for bytes and str - Use hash if available to optimize a==b and a!=b for bytes and str ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16286

[issue12119] distutils and python -B

2013-03-28 Thread Georg Brandl
Georg Brandl added the comment: Can this be closed? -- nosy: +georg.brandl status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12119 ___

[issue12119] distutils and python -B

2013-03-28 Thread Éric Araujo
Éric Araujo added the comment: In the absence of support for doing the right thing (which would break compatibility), I won’t change distutils here. -- stage: commit review - committed/rejected status: open - closed ___ Python tracker

[issue12119] distutils and python -B

2013-03-28 Thread sorin
sorin added the comment: Can we have a fix for this? ... one that would not require me to drop using PYTHONDONTWRITEBYTECODE. I do have PYTHONDONTWRITEBYTECODE=1 on my user profile and installing packages became a nightmare. -- nosy: +sorin ___

<    1   2   3   4   5   6   7   8   9   10   >