[issue10163] 7/200 and 7%200 show weird results

2010-10-21 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: The result of 7 / 200 is easy to explain -- this is how integer division works in Python 2. (To get a floating result, one of the numbers must be a float.) 200 % 7 giving 7 however is strange. Are you sure this is what you calculated?

[issue10163] 7/200 and 7%200 show weird results

2010-10-21 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: Which version of python? Could you run this from the command line and paste the complete session, including the version info that python prints on startup? -- nosy: +eric.smith, mark.dickinson ___

[issue10163] 7/200 and 7%200 show weird results

2010-10-21 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Seconding Eric's comment. This is what I get on my machine; can you cut and paste the equivalent output on yours (including whatever else is required to reproduce the results you describe) Python 2.6.1 (r261:67515, Feb 11 2010, 15:47:53)

[issue10163] 7/200 and 7%200 show weird results

2010-10-21 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: The bug title interestingly says 7%200, which does result in 7. I therefore think the OP just confused the order of operands for %. -- resolution: - invalid status: open - closed ___ Python tracker

Re: Weird try-except vs if behavior

2010-10-15 Thread Ryan Kelly
On Thu, 2010-10-14 at 22:43 -0700, James Matthews wrote: Hi, I have this code http://gist.github.com/627687 (I don't like pasting code into the mailing list). Yes, but it makes it harder to discuss the ode and makes the archive that much more useless. It's only a couple of lines, here ya

Re: Weird try-except vs if behavior

2010-10-15 Thread Terry Reedy
On 10/15/2010 3:11 AM, Ryan Kelly wrote: On Thu, 2010-10-14 at 22:43 -0700, James Matthews wrote: Hi, I have this code http://gist.github.com/627687 (I don't like pasting code into the mailing list). Yes, but it makes it harder to discuss the ode and makes the archive that much more useless.

Weird try-except vs if behavior

2010-10-14 Thread James Matthews
Hi, I have this code http://gist.github.com/627687 (I don't like pasting code into the mailing list). I am wondering why the try except is taking longer. I assume that if the IF statement checks every iteration of the loop (1000 times) shouldn't it be slower? James --

Re: [C-API] Weird sys.exc_info reference segfault

2010-10-06 Thread Antoine Pitrou
On Tue, 05 Oct 2010 16:17:57 +0200 Jonas H. jo...@lophus.org wrote: Right now I have this minimal struct: static PyTypeObject StartResponse_Type = { PyObject_HEAD_INIT(PyType_Type) 0, /* ob_size */ start_response, /* tp_name */

Re: [C-API] Weird sys.exc_info reference segfault

2010-10-06 Thread Jonas H.
On 10/06/2010 02:01 PM, Antoine Pitrou wrote: It shouldn't. Are you sure you're calling PyType_Ready in the module initialization routine? Yeah. The problem was that the type struct was declared 'static' in another module so the changes `PyType_Ready` made to the struct weren't applied

Re: [C-API] Weird sys.exc_info reference segfault

2010-10-05 Thread Jonas H.
On 10/04/2010 11:41 PM, Antoine Pitrou wrote: Well, it should work, but you have to call PyType_Ready() to fill in the NULL fields with default values (for those where it's necessary). Does it solve it for you? Yes, thank you! Although I do not understand which fields I have to provide. I

Re: [C-API] Weird sys.exc_info reference segfault

2010-10-04 Thread Jonas H.
On 10/03/2010 11:52 PM, Antoine Pitrou wrote: You probably have a problem in your tp_dealloc implementation. `tp_dealloc` is NULL... -- http://mail.python.org/mailman/listinfo/python-list

Re: [C-API] Weird sys.exc_info reference segfault

2010-10-04 Thread Jonas H.
On 10/04/2010 10:46 AM, Jonas H. wrote: On 10/03/2010 11:52 PM, Antoine Pitrou wrote: You probably have a problem in your tp_dealloc implementation. `tp_dealloc` is NULL... Alright, `tp_dealloc` must not be NULL because it's called by `_Py_Dealloc`. The C-API tutorial is quite confusing

Re: [C-API] Weird sys.exc_info reference segfault

2010-10-04 Thread Antoine Pitrou
On Mon, 04 Oct 2010 23:30:58 +0200 Jonas H. jo...@lophus.org wrote: [...] here's a minimal, but __complete__, module that defines a new type: [...] static PyTypeObject noddy_NoddyType = { [...] 0, /*tp_dealloc*/ [...] }; So I thought

Re: [C-API] Weird sys.exc_info reference segfault

2010-10-03 Thread Jonas H.
On 10/03/2010 01:16 AM, Antoine Pitrou wrote: You should check that you aren't doing anything wrong with env and start_response (like deallocate them forcefully). I commented out the `Py_DECREF(start_response)` after the `app` call and the crash was gone. `start_response` is created via

Re: [C-API] Weird sys.exc_info reference segfault

2010-10-03 Thread Antoine Pitrou
On Sun, 03 Oct 2010 14:44:32 +0200 Jonas H. jo...@lophus.org wrote: On 10/03/2010 01:16 AM, Antoine Pitrou wrote: You should check that you aren't doing anything wrong with env and start_response (like deallocate them forcefully). I commented out the `Py_DECREF(start_response)` after the

Re: [C-API] Weird sys.exc_info reference segfault

2010-10-03 Thread Jonas H.
On 10/03/2010 03:47 PM, Antoine Pitrou wrote: You shouldn't call PyObject_FREE yourself, but instead rely on Py_DECREF to deallocate it if the reference count drops to zero. So, instead of commenting out Py_DECREF and keeping PyObject_FREE, I'd recommend doing the reverse. That way, if a

Re: [C-API] Weird sys.exc_info reference segfault

2010-10-03 Thread Antoine Pitrou
On Sun, 03 Oct 2010 16:33:48 +0200 Jonas H. jo...@lophus.org wrote: Humm. Now the behaviour is as follows: with assignment to local variable -- * start_response = PyObject_NEW(...) - start_response-ob_refcnt=1 * wsgiapp(environ, start_response) -

[C-API] Weird sys.exc_info reference segfault

2010-10-02 Thread Jonas H.
Hello list, I have a really weird reference problem with `sys.exc_info`, and, if I'm right, function frames. The software in question is bjoern, a WSGI web server written in C, which you can find at http://github.com/jonashaag/bjoern. This WSGI application: def app(env, start_response

Re: [C-API] Weird sys.exc_info reference segfault

2010-10-02 Thread Antoine Pitrou
() [...] Now that is weird. The only difference between the two functions is that the second one (with the assignment) keeps a reference to the exc_info tuple in the function frame. Which creates a reference cycle, since you now have a local variable which has a reference to the exception traceback which

[issue9947] Weird locking in logging config system

2010-09-27 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: Fix checked into release31-maint (r85046). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9947 ___

[issue9947] Weird locking in logging config system

2010-09-25 Thread Armin Ronacher
fairness sake that method is probably never executed from more than one thread. -- assignee: vinay.sajip files: logging-config-threadsafety.patch keywords: patch messages: 117370 nosy: aronacher, vinay.sajip priority: normal severity: normal status: open title: Weird locking in logging

[issue9947] Weird locking in logging config system

2010-09-25 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: Fix checked into py3k and release27-maint, r85013. Thanks! -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9947

[issue9928] weird oddity with bz2 context manager

2010-09-23 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: I haven't investigated but this is weird (especially the fact that it doesn't *always* happen). There might be a problem with SETUP_WITH or perhaps the method cache: import bz2 f = bz2.BZ2File('foo.bz2', 'wb') with f: pass ... Traceback

[issue9928] weird oddity with bz2 context manager

2010-09-23 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Actually, it is because bz2 doesn't call PyType_Ready() but instead sets some field manually. Perhaps we could have a guard somewhere that raises a fatal error when a C extension type hasn't been properly readied? In the meantime, this patch

[issue9928] weird oddity with bz2 context manager

2010-09-23 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2010/9/23 Antoine Pitrou rep...@bugs.python.org: Antoine Pitrou pit...@free.fr added the comment: Actually, it is because bz2 doesn't call PyType_Ready() but instead sets some field manually. Perhaps we could have a guard somewhere

[issue9928] weird oddity with bz2 context manager

2010-09-23 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Patch committed in r84980 (3.2), r84981 (3.1) and r84982 (2.7). -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9928

Re: weird error with python 2.7 installer under windows 7

2010-09-22 Thread Martin v. Loewis
Any ideas? Try running the postinstall script by hand. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

weird error with python 2.7 installer under windows 7

2010-09-21 Thread Robin Becker
A colleague gets this error while testing a bdist wininst installer under windows 7 professional. This is on the page where the Post install script output appears. In the upper part I see Postinstall script finished. Click the Finish button to exit the setup wizard. In the bottom panel

Weird Python behaviour

2010-08-10 Thread Jonas Nilsson
Hello, Lets say that I want to feed an optional list to class constructor: class Family(): def __init__(self, fName, members = []): self.fName = fName self.members = members Now, lets add members to two different instances of Family: f1 = Family(Smith)

Re: Weird Python behaviour

2010-08-10 Thread Peter Otten
Jonas Nilsson wrote: Lets say that I want to feed an optional list to class constructor: class Family(): def __init__(self, fName, members = []): Why on earth is the output ['Bill', 'Joe']!? Is there a simple solution that separates f1 and f2 without forcing me to write code for the

Re: Weird Python behaviour

2010-08-10 Thread Benjamin Kaplan
On Tue, Aug 10, 2010 at 4:58 AM, Jonas Nilsson j...@spray.se wrote: Hello, Lets say that I want to feed an optional list to class constructor: class Family():        def __init__(self, fName, members = []):                self.fName = fName                self.members = members Now, lets

Re: Weird Python behaviour

2010-08-10 Thread Francesco Bochicchio
On 10 Ago, 13:58, Jonas Nilsson j...@spray.se wrote: Hello, Lets say that I want to feed an optional list to class constructor: class Family():         def __init__(self, fName, members = []):                 self.fName = fName                 self.members = members Now, lets add members

Re: Weird Python behaviour

2010-08-10 Thread Stefan Schwarzer
Hi, On 2010-08-10 17:01, Francesco Bochicchio wrote: There used to be a very nice (also graphic) explanationor this somewhere on the web, but my googling skills failed me this time, so instead I'll show you the concept using your own code: Probably this isn't the page you're referring to, but

Re: Weird Python behaviour

2010-08-10 Thread Jonas Nilsson
On 10 Ago, 13:58, Jonas Nilsson j...@spray.se wrote: You stumbled in two python common pitfalls at once :-) One, the default arguments issue, was already pointed to you. The other one is that python variables are just names for objects. Assigning a variable never mean making a copy, it

Re: Weird Python behaviour

2010-08-10 Thread Francesco Bochicchio
On 10 Ago, 17:57, Stefan Schwarzer sschwar...@sschwarzer.net wrote: Hi, On 2010-08-10 17:01, Francesco Bochicchio wrote: There used to be a very nice (also graphic) explanationor this somewhere on the web, but my googling skills failed me this time, so instead I'll show you the concept

Python acting weird

2010-07-25 Thread Westly Ward
x = {type:folder, name:sonicbot, data:[{type:folder, name:SonicMail, data:[{type:file, name:bbcode.py, compressed:False, contents:blahblahfilecontents}]}]} print x def setindict(dictionary, keys, value) : if len(keys) == 1 : if keys[0].isdigit() and int(keys[0]) == len(dictionary) :

Re: Python acting weird

2010-07-25 Thread Chris Rebert
On Sun, Jul 25, 2010 at 5:08 PM, Westly Ward sonicrules1...@gmail.com wrote: x = {type:folder, name:sonicbot, data:[{type:folder, name:SonicMail, data:[{type:file, name:bbcode.py, compressed:False, contents:blahblahfilecontents}]}]} print x def setindict(dictionary, keys, value) :    if

Re: weird pickle behavior in Python 3.1.2 + Eclipse 3.5.2

2010-06-08 Thread Fabio Zadrozny
On Mon, Jun 7, 2010 at 6:30 AM, Peter Otten __pete...@web.de wrote: kirby.ur...@gmail.com wrote: On Jun 4, 9:47 am, Peter Otten __pete...@web.de wrote: I can provoke the error in naked Python 3 by changing the Example.__module__ attribute: Python 3.1.1+ (r311:74480, Nov  2 2009, 15:45:00)

Re: weird pickle behavior in Python 3.1.2 + Eclipse 3.5.2

2010-06-08 Thread Peter Otten
Fabio Zadrozny wrote: On Mon, Jun 7, 2010 at 6:30 AM, Peter Otten __pete...@web.de wrote: kirby.ur...@gmail.com wrote: On Jun 4, 9:47 am, Peter Otten __pete...@web.de wrote: I can provoke the error in naked Python 3 by changing the Example.__module__ attribute: Python 3.1.1+ (r311:74480,

Re: weird pickle behavior in Python 3.1.2 + Eclipse 3.5.2

2010-06-07 Thread Peter Otten
kirby.ur...@gmail.com wrote: On Jun 4, 9:47 am, Peter Otten __pete...@web.de wrote: I can provoke the error in naked Python 3 by changing the Example.__module__ attribute: Python 3.1.1+ (r311:74480, Nov 2 2009, 15:45:00) [GCC 4.4.1] on linux2 Type help, copyright, credits or license for

weird pickle behavior in Python 3.1.2 + Eclipse 3.5.2

2010-06-04 Thread kirby.ur...@gmail.com
] pickle.dump(test,f) f.close() Any other Eclipse users out there who can at least duplicate this weirdness? Kirby Urner in Portland Keep Portland Weird Oregon -- http://mail.python.org/mailman/listinfo/python-list

Re: weird pickle behavior in Python 3.1.2 + Eclipse 3.5.2

2010-06-04 Thread Peter Otten
kirby.ur...@gmail.com wrote: Here we are in an Eclipse pydev console, running Python 3.1.2. For the most part, everything is working great. However... import sys; print('%s %s' % (sys.executable or sys.platform, sys.version)) C:\Python31\python.exe 3.1.2 (r312:79149, Mar 21 2010,

Re: weird pickle behavior in Python 3.1.2 + Eclipse 3.5.2

2010-06-04 Thread kirby.ur...@gmail.com
On Jun 4, 9:47 am, Peter Otten __pete...@web.de wrote: I can provoke the error in naked Python 3 by changing the Example.__module__ attribute: Python 3.1.1+ (r311:74480, Nov  2 2009, 15:45:00) [GCC 4.4.1] on linux2 Type help, copyright, credits or license for more information. import

Re: huh??? weird problem

2010-05-16 Thread Paul Hankin
On May 15, 3:41 am, Dave Angel da...@ieee.org wrote: cerr wrote: Hi There, I got following code: start=time.time() print 'warnTimeout '+str(WarnTimeout) print 'critTimeout '+str(CritTimeout) print 'start',str(start) while wait:     passed =  time.time()-start     print 'passed

huh??? weird problem

2010-05-14 Thread cerr
Hi There, I got following code: start=time.time() print 'warnTimeout '+str(WarnTimeout) print 'critTimeout '+str(CritTimeout) print 'start',str(start) while wait: passed = time.time()-start print 'passed ',str(passed) if passed = WarnTimeout: print ' Warning!' ... ... ...

Re: huh??? weird problem

2010-05-14 Thread Chris Rebert
On Fri, May 14, 2010 at 5:14 PM, cerr ron.egg...@gmail.com wrote: Hi There, I got following code: start=time.time() print 'warnTimeout '+str(WarnTimeout) print 'critTimeout '+str(CritTimeout) print 'start',str(start) while wait:    passed =  time.time()-start    print 'passed

Re: huh??? weird problem

2010-05-14 Thread Mensanator
On May 14, 7:14 pm, cerr ron.egg...@gmail.com wrote: Hi There, I got following code: start=time.time() print 'warnTimeout '+str(WarnTimeout) print 'critTimeout '+str(CritTimeout) print 'start',str(start) while wait:     passed =  time.time()-start     print 'passed ',str(passed)     if

Re: huh??? weird problem

2010-05-14 Thread Dave Angel
cerr wrote: Hi There, I got following code: start=time.time() print 'warnTimeout '+str(WarnTimeout) print 'critTimeout '+str(CritTimeout) print 'start',str(start) while wait: passed = time.time()-start print 'passed ',str(passed) if passed = WarnTimeout: print ' Warning!'

MySQLdb - weird formatting inconsistency

2010-04-24 Thread Anthra Norell
a MySQLdb problem and a pretty weird one at that. Suggestions? Thanks Frederic -- http://mail.python.org/mailman/listinfo/python-list

Re: MySQLdb - weird formatting inconsistency

2010-04-24 Thread Sebastian Bassi
Hi, Could you post a minimal version of the DB (a DB dump) to test it? Just remove most information and leave on the ones needed to reproduce the error. Also remove any personal/confidential information. Then dump the DB so I can test it here. Best, SB. --

Re: MySQLdb - weird formatting inconsistency

2010-04-24 Thread John Nagle
Anthra Norell wrote: Hi all, Can anyone explain this? Three commands with three different cutoff dates (12/30, 12/31 and 1/1) produce a formatting inconsistency. Examine the third field. The first and last run represents it correctly. The second run strips it. The field happens to be a

Re: MySQLdb - weird formatting inconsistency

2010-04-24 Thread Anthra Norell
Anthra Norell wrote: Sebastian Bassi wrote: Hi, Could you post a minimal version of the DB (a DB dump) to test it? Just remove most information and leave on the ones needed to reproduce the error. Also remove any personal/confidential information. Then dump the DB so I can test it here. Best,

[issue8483] asyncore.dispatcher.__repr__() is weird

2010-04-21 Thread Dirkjan Ochtman
)) return '%s at %#x' % (' '.join(status), id(self)) Which doesn't seem excessively complex... -- components: Library (Lib) messages: 103816 nosy: djc severity: normal status: open title: asyncore.dispatcher.__repr__() is weird versions: Python 2.6

[issue8483] asyncore.dispatcher.__repr__() is weird

2010-04-21 Thread Dirkjan Ochtman
Changes by Dirkjan Ochtman dirk...@ochtman.nl: -- nosy: +josiah.carlson, josiahcarlson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8483 ___ ___

[issue8483] asyncore.dispatcher.__repr__() is weird

2010-04-21 Thread Dirkjan Ochtman
Dirkjan Ochtman dirk...@ochtman.nl added the comment: Current guess for this behavior: dispatcher doesn't have __str__, so __getattr__ escalates to _socket.socket.__str__, which gets redirected to _socket.socket.__repr__. -- ___ Python tracker

[issue8483] asyncore.dispatcher.__repr__() is weird

2010-04-21 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8483 ___ ___

[issue8483] asyncore.dispatcher.__repr__() is weird

2010-04-21 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I'm not clear on what you are finding weird, here. Your issue title talks about __repr__, but your last post talks about __str__. -- nosy: +r.david.murray priority: - low ___ Python tracker

[issue8483] asyncore.dispatcher.__repr__() is weird

2010-04-21 Thread Dirkjan Ochtman
Dirkjan Ochtman dirk...@ochtman.nl added the comment: David, just have a look at the interpreter transcript, in particular the results of the print statements. I'm not sure why it happens, in my previous message I just stated a hypothesis. -- ___

[issue8483] asyncore.dispatcher.__repr__() is weird

2010-04-21 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: I think the problem relies in here: # cheap inheritance, used to pass all other attribute # references to the underlying socket object. def __getattr__(self, attr): return getattr(self.socket, attr) I wonder why this

[issue8483] asyncore.dispatcher.__repr__() is weird

2010-04-21 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I somehow missed the fact that B was a dispatcher subclass. Too early in my morning, I guess. So, I think the title of this issue should be asyncore.dispatcher's __repr__ not being used as fallback for __str__, and your speculation

[issue8483] asyncore.dispatcher.__repr__() is weird

2010-04-21 Thread Giampaolo Rodola'
a code which is fundamentally *already* wrong. Maybe we can do this in 2.7 and 3.2 only? The AttributeError message is *very* confusing. Actually I've seen it a lot of times through the years and never figured out it had to do with that weird __getattr__ statement

regex help: splitting string gets weird groups

2010-04-08 Thread gry
[ python3.1.1, re.__version__='2.2.1' ] I'm trying to use re to split a string into (any number of) pieces of these kinds: 1) contiguous runs of letters 2) contiguous runs of digits 3) single other characters e.g. 555tHe-rain.in#=1234 should give: [555, 'tHe', '-', 'rain', '.', 'in', '#',

Re: regex help: splitting string gets weird groups

2010-04-08 Thread MRAB
gry wrote: [ python3.1.1, re.__version__='2.2.1' ] I'm trying to use re to split a string into (any number of) pieces of these kinds: 1) contiguous runs of letters 2) contiguous runs of digits 3) single other characters e.g. 555tHe-rain.in#=1234 should give: [555, 'tHe', '-', 'rain', '.',

Re: regex help: splitting string gets weird groups

2010-04-08 Thread Jon Clements
On 8 Apr, 19:49, gry georgeryo...@gmail.com wrote: [ python3.1.1, re.__version__='2.2.1' ] I'm trying to use re to split a string into (any number of) pieces of these kinds: 1) contiguous runs of letters 2) contiguous runs of digits 3) single other characters e.g.   555tHe-rain.in#=1234  

Re: regex help: splitting string gets weird groups

2010-04-08 Thread Patrick Maupin
On Apr 8, 1:49 pm, gry georgeryo...@gmail.com wrote: [ python3.1.1, re.__version__='2.2.1' ] I'm trying to use re to split a string into (any number of) pieces of these kinds: 1) contiguous runs of letters 2) contiguous runs of digits 3) single other characters e.g.   555tHe-rain.in#=1234  

Re: regex help: splitting string gets weird groups

2010-04-08 Thread Tim Chase
it thinks its finding but nested capture-groups always produce somewhat weird results for me (I suspect that's what's triggering the duplication). Additionally, you're only searching for one match (.match() returns a single match-object or None; not all possible matches within the repeated

Re: regex help: splitting string gets weird groups

2010-04-08 Thread gry
On Apr 8, 3:40 pm, MRAB pyt...@mrabarnett.plus.com wrote: ... Group 1 and group 4 match '='. Group 1 and group 3 match '1234'. If a group matches then any earlier match of that group is discarded, Wow, that makes this much clearer! I wonder if this behaviour shouldn't be mentioned in some

Re: regex help: splitting string gets weird groups

2010-04-08 Thread Jon Clements
On 8 Apr, 19:49, gry georgeryo...@gmail.com wrote: [ python3.1.1, re.__version__='2.2.1' ] I'm trying to use re to split a string into (any number of) pieces of these kinds: 1) contiguous runs of letters 2) contiguous runs of digits 3) single other characters e.g.   555tHe-rain.in#=1234  

Re: regex help: splitting string gets weird groups

2010-04-08 Thread gry
    s='555tHe-rain.in#=1234'     import re     r=re.compile(r'([a-zA-Z]+|\d+|.)')     r.findall(s)    ['555', 'tHe', '-', 'rain', '.', 'in', '#', '=', '1234'] This is nice and simple and has the invertible property that Patrick mentioned above. Thanks much! --

Re: regex help: splitting string gets weird groups

2010-04-08 Thread Patrick Maupin
On Apr 8, 3:40 pm, gry georgeryo...@gmail.com wrote:     s='555tHe-rain.in#=1234'     import re     r=re.compile(r'([a-zA-Z]+|\d+|.)')     r.findall(s)    ['555', 'tHe', '-', 'rain', '.', 'in', '#', '=', '1234'] This is nice and simple and has the invertible property that Patrick

Hey Sci.Math, Musatov here. I know I've posted a lot of weird stuff trying to figure things out, but I really think I am onto something here and need some bright minds to have a look at this, comput

2010-04-02 Thread A Serious Moment
SPARSE COMPLETE SETS FOR NP: SOLUTION OF A CONJECTURE BY MARTIN MICHAEL MUSATOV * for llP: Sparse Comp1ete Sets Solution of a Conjecture In this paper we show if NP has a sparse complete set under many-one reductions, then ? NP. The result is extended to show NP is sparse reducible, then P =

Re: Hey Sci.Math, Musatov here. I know I've posted a lot of weird stuff trying to figure things out, but I really think I am onto something here and need some bright minds to have a look at this, co

2010-04-02 Thread Xavier Ho
On Fri, Apr 2, 2010 at 8:14 PM, A Serious Moment marty.musa...@gmail.comwrote: SPARSE COMPLETE SETS FOR NP: SOLUTION OF A CONJECTURE BY MARTIN MICHAEL MUSATOV * for llP: Sparse Comp1ete Sets Solution of a Conjecture Hi, If you're serious about this posting, could you please: 1)

[issue3151] elementtree serialization bug for weird namespace urls

2010-03-11 Thread Florent Xicluna
Florent Xicluna florent.xicl...@gmail.com added the comment: Fixed in trunk. -- dependencies: -Update ElementTree with upstream changes resolution: - fixed stage: patch review - committed/rejected status: open - closed superseder: - Update ElementTree with upstream changes

Re: very weird python bug..

2009-09-28 Thread Sampsa Riikonen
On Thursday 24 September 2009 02:01:52 pm Christian Heimes wrote: Sampsa Riikonen wrote: = If I start the program in directory paska2, everythings OK, but if the directory name happens to be python, the importation of the modules goes nuts! What's inside the python/ subdirectory? Do you

very weird python bug..

2009-09-24 Thread Sampsa Riikonen
): AttributeError: 'module' object has no attribute 'pack' --- = If I start the program in directory paska2, everythings OK, but if the directory name happens to be python, the importation of the modules goes nuts! Very Weird. Kind Regards, Sampsa -- Niin tärkeä ihmisoikeus kuin

Re: very weird python bug..

2009-09-24 Thread Christian Heimes
Sampsa Riikonen wrote: = If I start the program in directory paska2, everythings OK, but if the directory name happens to be python, the importation of the modules goes nuts! What's inside the python/ subdirectory? Do you happen to have a file called struct.py inside it? --

Re: weird str error

2009-09-17 Thread Peter Otten
daved170 wrote: On Sep 15, 6:29 pm, Peter Otten __pete...@web.de wrote: daved170 wrote: Hi everybody, I'm using SPE 0.8.3.c as my python editor. I'm using thestr() function and i got a very odd error. I'm trying to do this: printstr(HI) When i'm writing this line in the shell it

Re: weird str error

2009-09-16 Thread daved170
On Sep 15, 6:29 pm, Peter Otten __pete...@web.de wrote: daved170 wrote: Hi everybody, I'm using SPE 0.8.3.c as my python editor. I'm using thestr() function and i got a very odd error. I'm trying to do this: printstr(HI) When i'm writing this line in the shell it prints: HI When it's

[issue6924] struct.unpack weird behavior with bi (byte then integer)

2009-09-16 Thread Emmanuel Bengio
, 1684234849) # same again -- components: Library (Lib) messages: 92724 nosy: Manux severity: normal status: open title: struct.unpack weird behavior with bi (byte then integer) type: behavior versions: Python 2.6 ___ Python tracker rep...@bugs.python.org

[issue6924] struct.unpack weird behavior with bi (byte then integer)

2009-09-16 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I think this is expected behaviour: the key point is that structs can include padding bytes. From the documentation: By default, C numbers are represented in the machine’s native format and byte order, and properly aligned by skipping pad

Re: Odd/Weird errors with FTPLib

2009-09-15 Thread Bakes
On Sep 15, 1:32 am, MRAB pyt...@mrabarnett.plus.com wrote: Bakes wrote: On Sep 13, 11:47 pm, MRAB pyt...@mrabarnett.plus.com wrote: Bakes wrote: On 13 Sep, 22:41, Chris Rebert c...@rebertia.com wrote: On Sun, Sep 13, 2009 at 2:34 PM, Bakes ba...@ymail.com wrote: I am using a simple

Re: weird str error

2009-09-15 Thread Peter Otten
daved170 wrote: Hi everybody, I'm using SPE 0.8.3.c as my python editor. I'm using the str() function and i got a very odd error. I'm trying to do this: print str(HI) When i'm writing this line in the shell it prints: HI When it's in my code (it's the only line) i'm getting the following

Re: weird str error

2009-09-15 Thread Dave Angel
daved170 wrote: Hi everybody, I'm using SPE 0.8.3.c as my python editor. I'm using the str() function and i got a very odd error. I'm trying to do this: print str(HI) When i'm writing this line in the shell it prints: HI When it's in my code (it's the only line) i'm getting the following error:

Re: Odd/Weird errors with FTPLib

2009-09-14 Thread Bakes
On Sep 13, 11:47 pm, MRAB pyt...@mrabarnett.plus.com wrote: Bakes wrote: On 13 Sep, 22:41, Chris Rebert c...@rebertia.com wrote: On Sun, Sep 13, 2009 at 2:34 PM, Bakes ba...@ymail.com wrote: I am using a simple python script to download my logfiles. This is on a while loop, the logfile

Re: Odd/Weird errors with FTPLib

2009-09-14 Thread MRAB
Bakes wrote: On Sep 13, 11:47 pm, MRAB pyt...@mrabarnett.plus.com wrote: Bakes wrote: On 13 Sep, 22:41, Chris Rebert c...@rebertia.com wrote: On Sun, Sep 13, 2009 at 2:34 PM, Bakes ba...@ymail.com wrote: I am using a simple python script to download my logfiles. This is on a while loop, the

Odd/Weird errors with FTPLib

2009-09-13 Thread Bakes
I am using a simple python script to download my logfiles. This is on a while loop, the logfile grows rapidly, so it is necessary for python to start downloading the new script as soon as it has finished the old. It works fine (for about 20 minutes), then crashes. I have removed a couple of

Re: Odd/Weird errors with FTPLib

2009-09-13 Thread Chris Rebert
On Sun, Sep 13, 2009 at 2:34 PM, Bakes ba...@ymail.com wrote: I am using a simple python script to download my logfiles. This is on a while loop, the logfile grows rapidly, so it is necessary for python to start downloading the new script as soon as it has finished the old. It works fine

Re: Odd/Weird errors with FTPLib

2009-09-13 Thread Bakes
On 13 Sep, 22:41, Chris Rebert c...@rebertia.com wrote: On Sun, Sep 13, 2009 at 2:34 PM, Bakes ba...@ymail.com wrote: I am using a simple python script to download my logfiles. This is on a while loop, the logfile grows rapidly, so it is necessary for python to start downloading the new

Re: Odd/Weird errors with FTPLib

2009-09-13 Thread MRAB
Bakes wrote: On 13 Sep, 22:41, Chris Rebert c...@rebertia.com wrote: On Sun, Sep 13, 2009 at 2:34 PM, Bakes ba...@ymail.com wrote: I am using a simple python script to download my logfiles. This is on a while loop, the logfile grows rapidly, so it is necessary for python to start downloading

P3 weird sys.stdout.write()

2009-08-24 Thread Jerzy Jalocha N
I've stumbled upon the following in Python 3: Python 3.0.1+ (r301:69556, Apr 15 2009, 15:59:22) [GCC 4.3.3] on linux2 Type help, copyright, credits or license for more information. import sys sys.stdout.write() 0 sys.stdout.write(something) something9 write() is appending the length of the

Re: P3 weird sys.stdout.write()

2009-08-24 Thread Diez B. Roggisch
Jerzy Jalocha N wrote: I've stumbled upon the following in Python 3: Python 3.0.1+ (r301:69556, Apr 15 2009, 15:59:22) [GCC 4.3.3] on linux2 Type help, copyright, credits or license for more information. import sys sys.stdout.write() 0 sys.stdout.write(something) something9 write()

Re: P3 weird sys.stdout.write()

2009-08-24 Thread André
On Aug 24, 10:13 am, Jerzy Jalocha N jjalo...@gmail.com wrote: I've stumbled upon the following in Python 3: Python 3.0.1+ (r301:69556, Apr 15 2009, 15:59:22) [GCC 4.3.3] on linux2 Type help, copyright, credits or license for more information. import sys sys.stdout.write() 0

Re: P3 weird sys.stdout.write()

2009-08-24 Thread Jerzy Jalocha N
import sys n = sys.stdout.write('something') something n 9 Yes, that works as expected, now, similar to 2.6. Thank you both, Diez and André! -Jerzy -- http://mail.python.org/mailman/listinfo/python-list

Re: P3 weird sys.stdout.write()

2009-08-24 Thread Dave Angel
Jerzy Jalocha N wrote: I've stumbled upon the following in Python 3: Python 3.0.1+ (r301:69556, Apr 15 2009, 15:59:22) [GCC 4.3.3] on linux2 Type help, copyright, credits or license for more information. import sys sys.stdout.write() 0 sys.stdout.write(something)

Re: P3 weird sys.stdout.write()

2009-08-24 Thread Jerzy Jalocha N
On Mon, Aug 24, 2009 at 10:52 AM, Dave Angelda...@ieee.org wrote: The write() function changed in 3.0, but not in the way you're describing.  It now (usually) has a return value, the count of the number of characters written. [...] But because you're running from the interpreter, you're seeing

[issue3151] elementtree serialization bug for weird namespace urls

2009-07-03 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- priority: - normal stage: - patch review versions: +Python 2.7 -Python 2.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3151 ___

Re: Weird lambda behavior (bad for)

2009-04-26 Thread Aahz
In article gt0d15$167...@adenine.netfront.net, namekuseijin namekuseijin.nos...@gmail.com wrote: I don't like *for* at all. It both makes it tough to get true closures and also unnecessarily pollutes the namespace with non-local variables. Maybe. Consider this standard Python idiom: for x

Re: Weird lambda behavior (bad for)

2009-04-25 Thread namekuseijin
The real issue here has nothing to do with closures, lexical capture or anything like that. It's a long known issue called side-effects. Trying to program in a functional style in the presence of side-effects is bad. *for* is the main perpetrator of side-effects here, because it updates its

Weird lambda behavior

2009-04-22 Thread Rüdiger Ranft
Hi all, I want to generate some methods in a class using setattr and lambda. Within each generated function a name parameter to the function is replaced by a string constant, to keep trail which function was called. The problem I have is, that the substituted name parameter is not replaced by the

Re: Weird lambda behavior

2009-04-22 Thread Chris Rebert
On Wed, Apr 22, 2009 at 4:50 AM, Rüdiger Ranft _r...@web.de wrote: Hi all, I want to generate some methods in a class using setattr and lambda. Within each generated function a name parameter to the function is replaced by a string constant, to keep trail which function was called. The

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