These are chat archives for EntilZha/PyFunctional
Python library to extend functional operations in the spirit of functional programming in scala. Provides support for missing operations and chain style functional calls.
In : from fn import _ In : _ > 0 Out: (_ > 0) In : _ > 0 Out: ((_ > 0) > 0) In : _ == 0 Out: (((_ > 0) > 0) == 0)
seq.open("big.txt").take(10)is going to be much slower than
seq(open("big.txt")).take(10)on a big file.
iter(file)which iterates over lines without loading the whole file. Alternatively,
file.read(num_bytes)but that would require much more to handle manually.
sequsually expands the iterable thing
a = seq(...)
seek(0)the file, it resets it
takeperformance, but I'me not 100% sure
Lineage.evaluateI try to close it if it is a file
StopIterationor whatever the stop iteration exception is