dropbox / dropbox-sdk-python

The Official Dropbox API V2 SDK for Python
https://www.dropbox.com/developers
MIT License
932 stars 317 forks source link

Wrong return type for with_path_root/clone methods. #453

Closed Andredance closed 1 year ago

Andredance commented 1 year ago

Describe the bug If we are using DropboxTeam class and calling with_path_root method it will clone DropboxTeam class but return type specified in both with_path_root and self.clone methods is Dropbox. It causes misunderstanding for the user and IDE (for example Pycharm). It causes problems when you need to use __as_user method after calling with_path_root__ method. It will work, but IDE will backlight this as wrong since the docs return type is Dropbox for both DropboxTeam and Dropbox classes.

To Reproduce import dropbox from dropbox.common import PathRoot

dropbox.DropboxTeam(TOKEN).with_path_root(PathRoot.root(new_path_root)).as_user(user_id)

Expected Behavior The return type for the with_path_root method should be the same as the class calling that method.

Actual Behavior The return type is Dropbox class for both Dropbox and DropboxTeam classes.

Versions dropbox==11.36.0 MacOS platform