[issue40682] random.Random.seed() with version=1 does not consistently match Python 2 behavior

2020-05-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: The parts that are supposed to be stable are the seeding and the output of calls to random(). The sessions shown below show that this working as intended. The downstream algorithms such as randrange() are not protected by the reproducibility guarantees.

[issue40682] random.Random.seed() with version=1 does not consistently match Python 2 behavior

2020-05-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: 3.5 and 3.6 are now only accepting security fixes. Only the stability of random.random is guaranteed across versions, but you are calling randrange: https://docs.python.org/3/library/random.html#notes-on-reproducibility So I am pretty sure that this will

[issue40682] random.Random.seed() with version=1 does not consistently match Python 2 behavior

2020-05-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +mark.dickinson, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue40682] random.Random.seed() with version=1 does not consistently match Python 2 behavior

2020-05-19 Thread Micah R Ledbetter
is given the same seed. It's not clear from the docstring in the code whether this is intended to cover Python 2.7 behavior: https://github.com/python/cpython/blob/3.9/Lib/random.py#L134 > For version 2 (the default), all of the bits are used if *a* is a str, > bytes, or bytearray. For versio

[issue34274] Python launcher behavior with "#!/usr/bin/env python" shebang

2020-02-28 Thread Steve Dower
Change by Steve Dower : -- superseder: -> py.exe ignored PATH when using python3 shebang ___ Python tracker ___ ___

[issue34274] Python launcher behavior with "#!/usr/bin/env python" shebang

2020-02-28 Thread Steve Dower
Steve Dower added the comment: This is not strictly a duplicate of issue28686, but it's close enough, so let's keep the discussion of changing the original shebang behaviour over on that issue. -- resolution: -> duplicate stage: -> resolved status: open -> closed

[issue34274] Python launcher behavior with "#!/usr/bin/env python" shebang

2018-07-31 Thread Eryk Sun
Eryk Sun added the comment: See the discussion in issue 28686 regarding the use of version detection and/or versioned executable names with env shebangs. I think the launcher should at least support searching PATH for pythonX.exe and pythonX.Y.exe, so users can at least manually copy or

[issue34274] Python launcher behavior with "#!/usr/bin/env python" shebang

2018-07-29 Thread Segev Finer
install Python 2 as python and Python 3 as python3 (I think that's in the Makefile too). But of course there might also be distros that install python3 as python. -- title: Python launcher behavior with /usr/bin/env python shebang -> Python launcher be

[issue34274] Python launcher behavior with /usr/bin/env python shebang

2018-07-29 Thread Segev Finer
Change by Segev Finer : -- components: Windows nosy: Segev Finer, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: Python launcher behavior with /usr/bin/env python shebang type: behavior versions: Python 3.7

[issue12492] Inconsistent Python find() behavior

2011-07-05 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: I suspect this is a problem where url is reassigned to an integer somewhere in code that isn't shown to us. Please post the whole function and the whole traceback if you still think this is a valid bug. -- nosy: +georg.brandl

[issue12492] Inconsistent Python find() behavior

2011-07-05 Thread Juan Gonzalez
Juan Gonzalez juan.gonza...@ti.com added the comment: Today I tried to use parse() instead of find() and I found out the following response: tony@ubuntu:~/auto/sel/scripts$ python wtfibmdom Traceback (most recent call last): File wtfibmdom, line 22, in module if url.parse(str) 0:

[issue12492] Inconsistent Python find() behavior

2011-07-05 Thread Juan Gonzalez
Juan Gonzalez juan.gonza...@ti.com added the comment: Hi Georg, This is the python code listing: from RSS import ns, CollectionChannel, TrackingChannel #Create a tracking channel, which is a data structure that #Indexes RSS data by item URL tc = TrackingChannel() str =

[issue12492] Inconsistent Python find() behavior

2011-07-05 Thread Brian Curtin
Brian Curtin br...@python.org added the comment: Can you post some example code or a test case? -- nosy: +brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12492 ___

[issue12492] Inconsistent Python find() behavior

2011-07-05 Thread Jesús Cea Avión
Jesús Cea Avión j...@jcea.es added the comment: Put the failing code inside a try, and wrote in the except: print repr(url). I am pretty sure your url can be, actually, a number. Or print url just before the 'faulty' line. I guess you will be surprised. --

[issue12492] Inconsistent Python find() behavior

2011-07-05 Thread Brian Curtin
Changes by Brian Curtin br...@python.org: -- stage: - committed/rejected status: open - closed type: crash - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12492

[issue12492] Inconsistent Python find() behavior

2011-07-05 Thread Juan Gonzalez
Juan Gonzalez juan.gonza...@ti.com added the comment: I print 1 before the faulty line and like Jesús says I'm surprised I get a 1 Description: Build passed 1 Traceback (most recent call last): File wtfibmdom, line 23, in module if url.find(str) 0: AttributeError: 'int' object has no

[issue12492] Inconsistent Python find() behavior

2011-07-04 Thread Juan Gonzalez
$ python -V Python 2.7.1+ -- components: Regular Expressions messages: 139810 nosy: juan.gonzalez priority: normal severity: normal status: open title: Inconsistent Python find() behavior type: crash versions: Python 2.7 ___ Python tracker rep

[issue12492] Inconsistent Python find() behavior

2011-07-04 Thread Jesús Cea Avión
Jesús Cea Avión j...@jcea.es added the comment: Python 2.7.2 (default, Jun 16 2011, 01:46:46) [GCC 4.4.3] on linux2 Type help, copyright, credits or license for more information. hola.find(q) 0 False hola.find(q) 0 True I don't see the problem. Please, send a complete testcase. --

[issue12492] Inconsistent Python find() behavior

2011-07-04 Thread Jesús Cea Avión
Jesús Cea Avión j...@jcea.es added the comment: Note, anyway, that your python is not a real release. where is it coming from?. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12492 ___

Re: Python and behavior

2009-08-14 Thread ryles
On Aug 13, 8:36 pm, goldtech goldt...@worldpost.com wrote: Could you explain or link me to an explanation of this? http://docs.python.org/tutorial/datastructures.html#more-on-conditions Give the whole tutorial a good read. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and behavior

2009-08-14 Thread Duncan Booth
MRAB pyt...@mrabarnett.plus.com wrote: Operation Result |x or y| x if x else y |x and y| y if x else x |not x| False if x else False :-) That's not a terribly good definition for the 'not' operator. Try: |not x| False if x else True -- Duncan Booth

Re: Python and behavior

2009-08-14 Thread Ethan Furman
MRAB wrote: Gary Herron wrote: goldtech wrote: Could you explain or link me to an explanation of this? Been using Python for a while but not sure I understand what's happening below. Thanks. ss=1 and f ss 'f' ss=0 and f ss 0 Python's Boolean

Python and behavior

2009-08-13 Thread goldtech
Could you explain or link me to an explanation of this? Been using Python for a while but not sure I understand what's happening below. Thanks. ss=1 and f ss 'f' ss=0 and f ss 0 -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and behavior

2009-08-13 Thread Gary Herron
goldtech wrote: Could you explain or link me to an explanation of this? Been using Python for a while but not sure I understand what's happening below. Thanks. ss=1 and f ss 'f' ss=0 and f ss 0 Python's Boolean operators don't turn arbitrary values

Re: Python and behavior

2009-08-13 Thread Mensanator
On Aug 13, 7:36 pm, goldtech goldt...@worldpost.com wrote: Could you explain or link me to an explanation of this? Been using Python for a while but not sure I understand what's happening below. Thanks. ss=1 and f ss 'f' ss=0 and f ss 0 Does this help? ss = True

Re: Python and behavior

2009-08-13 Thread Stephen Hansen
Could you explain or link me to an explanation of this? Been using Python for a while but not sure I understand what's happening below. Thanks. ss=1 and f ss 'f' ss=0 and f ss 0 The and and or operators in Python are actually not true boolean operators: they operate

Re: Python and behavior

2009-08-13 Thread MRAB
Gary Herron wrote: goldtech wrote: Could you explain or link me to an explanation of this? Been using Python for a while but not sure I understand what's happening below. Thanks. ss=1 and f ss 'f' ss=0 and f ss 0 Python's Boolean operators don't

Re: Weird Python startup behavior between different drives on PowerPC platform

2008-07-21 Thread jwahlmann
Bump. Anyone have any ideas on this? My next step is to either link together a static version of the compiler or create a debug version. Thanks, Jon On Jul 18, 11:43 am, [EMAIL PROTECTED] wrote: I'm experiencing some strange behavior when starting up python on a Debian-based PowerPC

Weird Python startup behavior between different drives on PowerPC platform

2008-07-18 Thread jwahlmann
I'm experiencing some strange behavior when starting up python on a Debian-based PowerPC platform. Normally, I operate from this platform with a root file system on an IDE flash drive (/dev/hda1). However, I'm trying to get my system to run with root on a mechanical SATA drive (/dev/sda1). Both

Re: Python is behavior

2008-06-21 Thread Lie
On Jun 21, 2:14 am, Gary Herron [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: On Jun 20, 9:38 am, Jean-Paul Calderone [EMAIL PROTECTED] wrote: On Fri, 20 Jun 2008 09:31:57 -0700 (PDT), [EMAIL PROTECTED] wrote: I am not certain why this is the case, but... a = 256 b = 256 a is b

Re: Python is behavior

2008-06-21 Thread Martin v. Löwis
For some reason, stacking multiple statements reuses the same object. Each code object has a co_consts tuple referring to all constants used in the code. The compiler interns duplicate constants for a single compiler run, resulting in the same object being used when the code is put into a single

Python is behavior

2008-06-20 Thread michalis . avraam
I am not certain why this is the case, but... a = 256 b = 256 a is b True a = 257 b = 257 a is b False Can anyone explain this further? Why does it happen? 8-bit integer differences? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is behavior

2008-06-20 Thread Jean-Paul Calderone
On Fri, 20 Jun 2008 09:31:57 -0700 (PDT), [EMAIL PROTECTED] wrote: I am not certain why this is the case, but... a = 256 b = 256 a is b True a = 257 b = 257 a is b False Can anyone explain this further? Why does it happen? 8-bit integer differences?

Re: Python is behavior

2008-06-20 Thread George Sakkis
On Jun 20, 12:31 pm, [EMAIL PROTECTED] wrote: I am not certain why this is the case, but... a = 256 b = 256 a is b True a = 257 b = 257 a is b False Can anyone explain this further? Why does it happen? 8-bit integer differences? No, implementation-dependent optimization

Re: Python is behavior

2008-06-20 Thread michalis . avraam
On Jun 20, 9:38 am, Jean-Paul Calderone [EMAIL PROTECTED] wrote: On Fri, 20 Jun 2008 09:31:57 -0700 (PDT), [EMAIL PROTECTED] wrote: I am not certain why this is the case, but... a = 256 b = 256 a is b True a = 257 b = 257 a is b False Can anyone explain this further? Why does

Re: Python is behavior

2008-06-20 Thread michalis . avraam
On Jun 20, 9:42 am, George Sakkis [EMAIL PROTECTED] wrote: On Jun 20, 12:31 pm, [EMAIL PROTECTED] wrote: I am not certain why this is the case, but... a = 256 b = 256 a is b True a = 257 b = 257 a is b False Can anyone explain this further? Why does it happen?

Re: Python is behavior

2008-06-20 Thread George Sakkis
On Jun 20, 12:45 pm, [EMAIL PROTECTED] wrote: On Jun 20, 9:42 am, George Sakkis [EMAIL PROTECTED] wrote: On Jun 20, 12:31 pm, [EMAIL PROTECTED] wrote: I am not certain why this is the case, but... a = 256 b = 256 a is b True a = 257 b = 257 a is b False

Re: Python is behavior

2008-06-20 Thread Jean-Paul Calderone
On Fri, 20 Jun 2008 10:07:56 -0700 (PDT), George Sakkis [EMAIL PROTECTED] wrote: On Jun 20, 12:45 pm, [EMAIL PROTECTED] wrote: On Jun 20, 9:42 am, George Sakkis [EMAIL PROTECTED] wrote: On Jun 20, 12:31 pm, [EMAIL PROTECTED] wrote: I am not certain why this is the case, but... a =

Re: Python is behavior

2008-06-20 Thread Gary Herron
[EMAIL PROTECTED] wrote: On Jun 20, 9:38 am, Jean-Paul Calderone [EMAIL PROTECTED] wrote: On Fri, 20 Jun 2008 09:31:57 -0700 (PDT), [EMAIL PROTECTED] wrote: I am not certain why this is the case, but... a = 256 b = 256 a is b True a = 257 b = 257 a is b

Re: Win32 python: odd behavior when run via ssh

2008-02-02 Thread Thorsten Kampe
* Gabriel Genellina (Fri, 01 Feb 2008 23:13:27 -0200) En Fri, 01 Feb 2008 22:31:06 -0200, Ross Ridge [EMAIL PROTECTED] escribió: If you're using the offficial Win32 port of Python than you probably want to use the Cygwin version because Win32 version doesn't support readline anyways.

Win32 python: odd behavior when run via ssh

2008-02-01 Thread Grant Edwards
When I ssh into a windows machine (running Cygwin sshd), I can invoke python at the shell prompt (you have to use -i option and I don't really understand why). Once it's started there are couple rather odd behaviors: 1) readline support doesn't work. 2) you have call sys.exit() to exit

Re: Win32 python: odd behavior when run via ssh

2008-02-01 Thread Ross Ridge
Grant Edwards [EMAIL PROTECTED] wrote: When I ssh into a windows machine (running Cygwin sshd), I can invoke python at the shell prompt (you have to use -i option and I don't really understand why). Once it's started there are couple rather odd behaviors: 1) readline support doesn't work. My

Re: Win32 python: odd behavior when run via ssh

2008-02-01 Thread Grant Edwards
On 2008-02-02, Ross Ridge [EMAIL PROTECTED] wrote: When I ssh into a windows machine (running Cygwin sshd), I can invoke python at the shell prompt (you have to use -i option and I don't really understand why). Once it's started there are couple rather odd behaviors: 1) readline support

Re: Win32 python: odd behavior when run via ssh

2008-02-01 Thread Gabriel Genellina
En Fri, 01 Feb 2008 22:31:06 -0200, Ross Ridge [EMAIL PROTECTED] escribió: If you're using the offficial Win32 port of Python than you probably want to use the Cygwin version because Win32 version doesn't support readline anyways. I don't understand the comment. Most of the readline

Re: Win32 python: odd behavior when run via ssh

2008-02-01 Thread Martin v. Löwis
That's odd, because readline seems to work fine in a Windows console (recalling previous lines and line editing). That's an illusion. The Windows version of Python does not support or use GNU readline at all. What you see is a feature of the console window. Regards, Martin --

Re: Win32 python: odd behavior when run via ssh

2008-02-01 Thread Grant Edwards
On 2008-02-02, Gabriel Genellina [EMAIL PROTECTED] wrote: En Fri, 01 Feb 2008 22:31:06 -0200, Ross Ridge [EMAIL PROTECTED] escribió: If you're using the offficial Win32 port of Python than you probably want to use the Cygwin version because Win32 version doesn't support readline anyways.

Re: Win32 python: odd behavior when run via ssh

2008-02-01 Thread Steve Holden
Gabriel Genellina wrote: En Fri, 01 Feb 2008 22:31:06 -0200, Ross Ridge [EMAIL PROTECTED] escribió: If you're using the offficial Win32 port of Python than you probably want to use the Cygwin version because Win32 version doesn't support readline anyways. I don't understand the

Re: Win32 python: odd behavior when run via ssh

2008-02-01 Thread Gabriel Genellina
En Sat, 02 Feb 2008 01:40:50 -0200, Steve Holden [EMAIL PROTECTED] escribi�: Gabriel Genellina wrote: I don't understand the comment. Most of the readline functionality is already present on Windows XP (command history, up/down arrows, edit [...] Until you try to do something like a