Python: function, passing argument -


I am new to python and I have a stupid problem to pass through logic.

  class MyClass (): @staticmethod def add_group (name, parent_id): print "add_group method, name:% s, parent_id:% s"% (name, parent_id)   

Other classes

  def (): print "work method, name:% s, group_id:% s"% (name, parent_id) MyClass.add_group (name , Parent_id)   

Output:

  function method, name: blabla, group_id: 15 add_group method, name: blabla, parent_id: (15L,) < / Code>  

What's happened with parent_id argument? Any help would be appreciated!

In one case you 15 in the second case you (15L ,) (i.e. a tubal whose first value is 15 L, it is passed long, representing (15) or a arbitrary-precise number 15).

When the number is very high, such as 10 ** 20, but in this case it is very small, then the number changes naturally in a long time; The only way I can think that you would have had a long time, you were not expecting that something was doing something like 10 ** 20 - 10 ** 20 + 15 Some other value in the program is a long one.

Edit : In particular, the second value in your program is being returned by the library you are using.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -