Skip to content

Removed future print_function, division, and with_statement and some pre 3.7 handling - #1208

Merged
absurdfarce merged 1 commit into
apache:masterfrom
bschoening:master
May 31, 2024
Merged

Removed future print_function, division, and with_statement and some pre 3.7 handling#1208
absurdfarce merged 1 commit into
apache:masterfrom
bschoening:master

Conversation

@bschoening

@bschoeningbschoening commented May 7, 2024

Copy link
Copy Markdown
Contributor

Removed unnecessary future print_function, division, and with and some pre 3.0 handling

Does not touch __future__imports!

@bschoeningbschoening changed the title Removed future print_function, division, and with and some pre 3.7 handlingRemoved future print_function, division, and with_statement and some pre 3.7 handlingMay 20, 2024
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import division

@absurdfarceabsurdfarceMay 29, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per PEP-238 the effect of this future import in 2.x was to enforce true division "throughout a module". In Python3 / is understood to mean true division generally... so there is no impact to this removal t'all.

Comment threadcassandra/util.py
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import with_statement

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per PEP-343 this became standard syntax in 2.6... this could've been removed long ago. :(

# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import print_function

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure... this one is actually used anywhere. Regardless it's absolutely safe to remove for Python3.

# integer division used here to emulate built-in total_seconds
return ((86400 * td.days + td.seconds) * 10 ** 6 + td.microseconds) / 10 ** 6
def get_total_seconds(td):
return td.total_seconds()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @bschoening, this one is also removed by another PR that I'm looking to merge in order to clean up the mock usages. Would you mind rebasing this against master once I get that PR in? Should go in later today.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To follow up: the other PR has been merged. Should be a pretty straightforward conflict resolution @bschoening ... I'm really hoping I didn't inadvertently mess you up here. :(

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@absurdfarce no problem, I'll rebase it.

@bschoening

Copy link
Copy Markdown
ContributorAuthor

@absurdfarce updated the PR so it has no merge conficts.

@absurdfarce
absurdfarce merged commit 9cc4225 into apache:masterMay 31, 2024
@absurdfarce

Copy link
Copy Markdown
Contributor

Thanks as always @bschoening !

dkropachev pushed a commit to dkropachev/python-driver that referenced this pull request Mar 5, 2025
dkropachev pushed a commit to dkropachev/python-driver that referenced this pull request Mar 5, 2025
dkropachev pushed a commit to dkropachev/python-driver that referenced this pull request Mar 5, 2025
dkropachev pushed a commit to scylladb/python-driver that referenced this pull request Mar 5, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@bschoening@absurdfarce