so something i do to learn is try and break something i dont understand into the smallest piece i do understand, entirely, as far as functions.
i tried doing this with pythons random library, because i was interested in knowing how they generated pseudo randoms because it's a subject of interest to me.
being very not well versed in anything, and still a beginner in python, this is probably a recipe for distaster. at any rate i did it anyway.
so in the random.py script, the first thing they import is:
Code:
from __future__ import division
ok neat, i have no idea what __future__ is, but it is presumably a library. and it presumably has a function for how python performs division. that is exciting.
i then went to __future__.py and found the following definition for division:
Code:
division = _Feature((2, 2, 0, "alpha", 2),
(3, 0, 0, "alpha", 0),
CO_FUTURE_DIVISION)
where the _Feature class is:
Code:
class _Feature:
def __init__(self, optionalRelease, mandatoryRelease, compiler_flag):
self.optional = optionalRelease
self.mandatory = mandatoryRelease
self.compiler_flag = compiler_flag
and the CO_FUTURE_DIVISION appears to apply some sort of abstract sequence as follows to that variable:
Code:
CO_FUTURE_DIVISION = 0x2000 # division
is this 0x2000 sequence a different language for something? is it the actual language python is using to communicate with the cpu itself?
thanks and sorry for the beginner questions, am i better served asking these on stackoverflow? i tried searching for them but i couldnt really get a good idea of how to look at the python standard library from a noobies perspective.