Giter Club home page Giter Club logo

Comments (3)

andy-z avatar andy-z commented on June 25, 2024

To add more detail - this is seen on the same host (VM) running Ubuntu 20.04. For both Python 2 and 3 I have a virtualenv with pip install convertdate. convertdate version is 2.2.1 for both of them.

from convertdate.

fitnr avatar fitnr commented on June 25, 2024

The short explanation is that the behavior of the Hebrew calendar isn't defined prior to the start of the universe.

The long explanation is that this is due to the differences between division in Python 2 and 3. One of the supporting functions (hebrew.delay_1) performs a calculation that looks like this:

from math import trunc
trunc((235 * year - 234) / 19)

When year is positive, the result in Python2 and 3 is the same. When year is negative, they behave differently. The solution is to add from __future__ import division to the top of the file. The other, perhaps more apt, solution would be to raise an error when year is less than 1.
I'm going to mark this is low priority, since it involves making a change for an invalid calculation in a EOL'd version of the language.

from convertdate.

rlskoeser avatar rlskoeser commented on June 25, 2024

@fitnr I think it's reasonable for you to close this one, given that python2 was EOL January 1, 2020!

from convertdate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.