Giter Club home page Giter Club logo

Comments (8)

jackos avatar jackos commented on May 13, 2024 3

@paugier it's fixed in the next release 0.6.0

from mojo.

stumpOS avatar stumpOS commented on May 13, 2024 2

Yes it is fixed

from mojo.

paugier avatar paugier commented on May 13, 2024 1

It seems that it is not fixed with Mojo 0.0.5 and that this issue could be reopened:

    let python_builtins: PythonObject = Python.import_module("builtins")
    let dict: PythonObject = python_builtins.dict
    let d: PythonObject = dict()
    # error: expression must be mutable in assignment (with Mojo 0.0.5)
    # d["a"] = 0
    # works:
    d.__setitem__("a", 0)
    print(d["a"])

from mojo.

jradxl avatar jradxl commented on May 13, 2024 1

I'm not convinced it's fixed in 0.7 either

 let smtp1 = Python.import_module("smtplib")
    let emtext1 = Python.import_module("email.mime.text")
    var msg = emtext1.MIMEText(body)
    msg['Subject'] = "Hello!"
    #error: expression must be mutable in assignment

    let python_builtins: PythonObject = Python.import_module("builtins")
    let dict: PythonObject = python_builtins.dict
    let d = dict()
    # works:
    d.__setitem__("a", 2345)
    #warning: 'PythonObject' value is unused

__setitem__ issues a warning, but does work.
In VsCode, only __setattr__ appears in the intelisence

I'm new to Mojo. so sorry if I've misunderstood
Does anyone send Emails using Mojo?

from mojo.

lattner avatar lattner commented on May 13, 2024

Steffi is on it, thank you!

from mojo.

Mogball avatar Mogball commented on May 13, 2024

Thanks for the feature request! This should be straightforward to add @stumpOS

edit: ninja'd

from mojo.

lattner avatar lattner commented on May 13, 2024

@stumpOS I think you fixed this already?

from mojo.

fnands avatar fnands commented on May 13, 2024

@jackos , I'm trying 0.6.0, and I'm guessing this didn't make it in?

from mojo.

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.