GithubHelp home page GithubHelp logo

Comments (5)

saffsd avatar saffsd commented on August 29, 2024

Hi Zheyi

Thanks for the suggestion. Does this change the behavior of the program,
especially across versions of Python? Or is the default iterator over
sys.stdin actually sys.stdin.readlines throughout? I haven't actually been
able to find the relevant Python documentation.

Cheers,
Marco

On Tue, Mar 17, 2015 at 2:48 AM, Rong Zheyi [email protected]
wrote:

Hello,

I am trying out this fancy language detection script,
and I am actually thinking -
do you think it makes more sense to make
for line in sys.stdin.readlines():
into
for line in sys.stdin:

in langid.py ?

β€”
Reply to this email directly or view it on GitHub
#29.

from langid.py.

parafish avatar parafish commented on August 29, 2024

I am not sure whether this would change the behavior of the program across versions of Python.
I raised this because readlines() will return a list, and this causes scalability problem - when the input is too big.

from langid.py.

jnothman avatar jnothman commented on August 29, 2024

fwiw, for line in sys.stdin: should be functionally identically to for line in sys.stdin.readlines(): but streaming.

from langid.py.

jnothman avatar jnothman commented on August 29, 2024

And I can't speak for anything before Python 2.3, but it worked then, I'm fairly certain.

from langid.py.

saffsd avatar saffsd commented on August 29, 2024

Fixed, thanks to tripleee, rongzhenyi and jnothman.

from langid.py.

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.