1 |
René 'Necoro' Neumann yazmış: |
2 |
> What's the best way to send patches for the patches ;) ? |
3 |
|
4 |
In this particular case you shouldn't send patches for patches, so it's |
5 |
not a problem, see below ;) |
6 |
|
7 |
<snip> |
8 |
> But the complete expression could be rewritten as: |
9 |
> |
10 |
> return [int(fd) for fd in os.listdir("/proc/%i/fd" % os.getpid()) if |
11 |
> fd.isdigit()] |
12 |
> |
13 |
> This is more readable - and you don't need to traverse the list multiple |
14 |
> times. |
15 |
> |
16 |
> Alternatively - if you like the functional style more: |
17 |
> |
18 |
> return list(map(int, filter(str.isdigit, os.listdir("/proc/%i/fd" % |
19 |
> os.getpid())))) |
20 |
> |
21 |
> Again more readable (if you are used to the functional style ;)) - and only |
22 |
> one traversal (as iterators are used). |
23 |
> |
24 |
|
25 |
Portage aims for 2.4 compatibility and your snippets should work on 2.4 |
26 |
afaik. So you can submit it as a patch to the current trunk. |
27 |
Changing the automatically generated output is not a good idea. |
28 |
|
29 |
> Regards, |
30 |
> Necoro |
31 |
|
32 |
-- |
33 |
Regards, |
34 |
Ali Polatel |