On Sat, Jun 29, 2013 at 9:36 AM, Ethan Furman wrote:
> On 06/27/2013 03:49 PM, Steven D'Aprano wrote:
>
>>
>> Libraries should not call sys.exit, or raise SystemExit. Whether to quit
>> or not is not the library's decision to make, that decision belongs to
>> the application layer. Yes, the appli
You underestimated the arrogance of Python. Python 3 tab doesn't map to 4
spaces. It doesn't map to any number of spaces. Tabs and spaces are
completely unrelated. If you have a function having the first indentation
level with 4 (or any number of) spaces, the next line starting not with 4
space
In general, it is hard for any process to return the memory the OS allocate
to it back to the OS, short of exiting the whole process. The only case
that this works reliably is when the process allocates a chunk of memory by
mmap (which is chosen by libc if it malloc or calloc a large chunk of
memo
On Mon, Feb 11, 2013 at 8:27 PM, Oscar Benjamin
wrote:
> On 11 February 2013 06:50, Isaac To wrote:
> > Except one thing: it doesn't really work. If I `import foo.baz.mymod`
> now,
> > and if in "bar.baz.mymod" there is a statement `import bar.baz.depmod`,
&
I have a package (say "foo") that I want to rename (say, to "bar"), and for
compatibility reasons I want to be able to use the old package name to
refer to the new package. Copying files or using filesystem symlinks is
probably not the way to go, since that means any object in the modules of
the p
> "Paul" == Paul Moore <[EMAIL PROTECTED]> writes:
Paul> You can work around the need for something like yield_all,
Paul> or explicit loops, by defining an "iflatten" generator,
Paul> which yields every element of its (iterable) argument,
Paul> unless the element is a generator
> "Douglas" == Douglas Alan <[EMAIL PROTECTED]> writes:
Douglas> If you actually try doing this, you will see why I want
Douglas> "yield_all".
Oh... I see your point.
I was about to suggest that the code in my posts before should be made
to work somehow. I mean, if in
def fun1(x)
>>>>> "Isaac" == Isaac To <[EMAIL PROTECTED]> writes:
def gen_all(gen):
for e in gen:
yield e
def foogen(arg1):
def foogen1(arg2):
# Some code here
# Some code here
gen_all(arg3)
^ I mean foogen1(arg3), obviously, and si
> "Douglas" == Douglas Alan <[EMAIL PROTECTED]> writes:
Douglas> If you'll reread what I wrote, you'll see that I'm not
Douglas> concerned with performance, but rather my concern is that
Douglas> I want the syntactic sugar. I'm tired of writing code
Douglas> that looks like
> "beliavsky" == beliavsky <[EMAIL PROTECTED]> writes:
beliavsky> I think the OO way is slightly more obscure. It's
beliavsky> obvious what x = reverse(x) does, but it is not clear
beliavsky> unless you have the source code whether x.reverse()
beliavsky> reverses x or if it re
> "Mike" == Mike Meyer <[EMAIL PROTECTED]> writes:
Mike> I think it's a bit abnormal, because you have to scan the
Mike> loop body for breaks. I tend to write:
Mike> condition = True
Mike> while condition: # corrected
Mike> #code which iterates my simulation
Then you
> "Greg" == Greg Ewing <[EMAIL PROTECTED]> writes:
>> The only punctuation you *need* is whitespace. See Forth
Greg> You don't even need that... see FORTRAN. :-)
And you don't need everything else either... see this.
http://compsoc.dur.ac.uk/whitespace/
:-)
Regard
12 matches
Mail list logo