Home  >  Q&A  >  body text

django - Python一系列的问题来临

  1. 函数传过来的参数中字符串和列表有什么区别?进行修改呢?

  2. Django如何用类写views?他和函数写view有甚区别?

  3. Django的module中由两个表,a关联b表的外建,怎么实现删除a表不影响b表?

  4. Tornado异步,是如何实现的?

  5. 多线程有什么问题?

  6. 类中的init方法和new方法的区别

  7. 描述一下单例模式

  8. Python中的垃圾回收机制

巴扎黑巴扎黑2714 days ago391

reply all(3)I'll reply

  • 怪我咯

    怪我咯2017-04-18 09:52:03

    Hello, are you the one who came for the interview yesterday? These questions are mainly to test your familiarity with the language and framework, and they need to be accumulated slowly. Even if you understand these questions through here, there will definitely be other different questions in the next interview. I suggest you pay more attention to your daily accumulation. The fact that you can remember so many interview questions shows that you are quite smart. I see that there is a lot of content in your blog. I think it will be greatly improved if you review all the content of your blog.

    reply
    0
  • PHPz

    PHPz2017-04-18 09:52:03

    First of all, it is recommended that you use a search engine to solve the problem before asking a question. If you really can't solve it, ask again.

    Secondly, don’t ask multiple questions together, otherwise no one will be willing to answer.

    Let me answer the first question simply: all variables (including function parameters) in Python are references to objects, strings are immutable objects, and lists are mutable objects, which means that string parameters are modified within the function body. , will not affect the outside of the function, but modifications to the list parameters may affect the outside of the function.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 09:52:03

    What is the difference between string and list in the parameters passed by the function? What about modifications?

    Strings are immutable and cannot be modified. Modifications to list elements are propagated to the caller.

    How to write views using classes in Django? What is the difference between it and function writing view?

    Overloading__call__method makes a class callable. The types are different but there is no difference in usage

    There are two tables in Django’s module. A is related to the external structure of table b. How can I delete table a without affecting table b?

    Add a media table, and two foreign keys point to ab,删除a和没媒介表不影响b respectively.

    Tornado asynchronous, how is it implemented?

    The bottom layer of OS provides an asynchronous IO interface, which is not a commonly used synchronous interface. Using a synchronous interface to achieve asynchronous implementation is impossible to achieve anyway.

    What’s wrong with multi-threading?

    There are two aspects (1) Concurrency model (2) How to avoid deadlock. See Wikipedia for details.

    The difference between the init method and the new method in the class

    new返回分配的空间。initCall on allocated space.

    Describe the singleton pattern

    https://zh.wikipedia.org/wiki...

    Garbage collection mechanism in Python

    Python’s GC is not generational like Java, but reference counting. GC is just one application layer of reference counting, and there is a lot of information on it.

    reply
    0
  • Cancelreply