Skip to main content
Typo fix
Source Link
Toby Speight
  • 88.7k
  • 14
  • 104
  • 327

You miss imports for your function (I believe it is somewhere in your code, but not in the posted snippedsnippet):

from collections import defaultdict import os 

Creation of files variable inside of the recursive function looks a bit weird from my non-Python point of view, but it has its advantages as you optional arguments can be skipped (scan different directory, append results to existing list of files), which seems to be a good design.

I can criticize the function naming. recursive_ftp does not explain what does the function do. It is recursive (but it does not add much value) and it is not ftp. I might think about list_sftp?

You miss imports for your function (I believe it is somewhere in your code, but not in the posted snipped):

from collections import defaultdict import os 

Creation of files variable inside of the recursive function looks a bit weird from my non-Python point of view, but it has its advantages as you optional arguments can be skipped (scan different directory, append results to existing list of files), which seems to be a good design.

I can criticize the function naming. recursive_ftp does not explain what does the function do. It is recursive (but it does not add much value) and it is not ftp. I might think about list_sftp?

You miss imports for your function (I believe it is somewhere in your code, but not in the posted snippet):

from collections import defaultdict import os 

Creation of files variable inside of the recursive function looks a bit weird from my non-Python point of view, but it has its advantages as you optional arguments can be skipped (scan different directory, append results to existing list of files), which seems to be a good design.

I can criticize the function naming. recursive_ftp does not explain what does the function do. It is recursive (but it does not add much value) and it is not ftp. I might think about list_sftp?

Source Link
Jakuje
  • 316
  • 3
  • 8

You miss imports for your function (I believe it is somewhere in your code, but not in the posted snipped):

from collections import defaultdict import os 

Creation of files variable inside of the recursive function looks a bit weird from my non-Python point of view, but it has its advantages as you optional arguments can be skipped (scan different directory, append results to existing list of files), which seems to be a good design.

I can criticize the function naming. recursive_ftp does not explain what does the function do. It is recursive (but it does not add much value) and it is not ftp. I might think about list_sftp?