A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-August/103147.html below:

[Python-Dev] Possible bug in randint when importing pylab?

[Python-Dev] Possible bug in randint when importing pylab? [Python-Dev] Possible bug in randint when importing pylab?Timothy Kinney timothyjkinney at gmail.com
Thu Aug 19 08:11:17 CEST 2010
I am getting some unexpected behavior in Python 2.6.4 on a WinXP SP3 box.

If I run the following:

[code]
from pylab import randint

for s in range(100):
    print randint(0,1)
[/code]

I get 100 zeroes.

If I import randint from random instead, I get the expected behavior
of a random distribution of 1s and 0s.

I found this by importing * from pylab after importing randint from random.

What is going on? Is pylab's randint function broken somehow? Could
this be due to installing scipy into a 2.6 environment when it was
designed for the 2.5 environment?

cinead
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4