Re: why function throws an error?

2022-06-28 Thread Dennis Lee Bieber
On Tue, 28 Jun 2022 10:57:59 +0300, ???   declaimed
the following:

>def add_route(self, route):
>#""" Add a route object, but do not change the :data:`Route.app`
>#attribute."""
>self.routes.append(route)
>self.router.add(route.rule, route.method, route, name=route.name
>)
>#if DEBUG: route.prepare()

From your subject "why function throws an error?".

How would we know? You never show us the error traceback, you never
provide a minimal code listing that someone could attempt to run to perform
debugging.



-- 
Wulfraed Dennis Lee Bieber AF6VN
wlfr...@ix.netcom.comhttp://wlfraed.microdiversity.freeddns.org/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: why function throws an error?

2022-06-28 Thread Lars Liedtke

Hey,

Which error does it throw?
Could you please send the stacktrace as well?

Cheers

Lars


--
Lars Liedtke
Software Entwickler


Phone:  
Fax:+49 721 98993-
E-mail: l...@solute.de


solute GmbH
Zeppelinstraße 15   
76185 Karlsruhe
Germany


Marken der solute GmbH | brands of solute GmbH
billiger.de | Shopping.de 



Geschäftsführer | Managing Director: Dr. Thilo Gans, Bernd Vermaaten
Webseite | www.solute.de
Sitz | Registered Office: Karlsruhe
Registergericht | Register Court: Amtsgericht Mannheim
Registernummer | Register No.: HRB 110579
USt-ID | VAT ID: DE234663798


Informationen zum Datenschutz | Information about privacy policy
http://solute.de/ger/datenschutz/grundsaetze-der-datenverarbeitung.php

Am 28.06.22 um 09:57 schrieb נתי שטרן:

 def add_route(self, route):
 #""" Add a route object, but do not change the :data:`Route.app`
 #attribute."""
 self.routes.append(route)
 self.router.add(route.rule, route.method, route, name=route.name
)
 #if DEBUG: route.prepare()
--



--
https://mail.python.org/mailman/listinfo/python-list


Re: why function throws an error?

2022-06-28 Thread Mirko via Python-list

Am 28.06.22 um 09:57 schrieb נתי שטרן:

 def add_route(self, route):
 #""" Add a route object, but do not change the :data:`Route.app`
 #attribute."""
 self.routes.append(route)
 self.router.add(route.rule, route.method, route, name=route.name
)
 #if DEBUG: route.prepare()
--



Are you still trying to combine different modules into one large 
module? That is not going to help you. First, you need to rewrite 
all those modules to seamlessly work together. This will likely be a 
huge task. Let's say you have a module that defines some function 
route():


def route():
print("route")

Another module defines a variable called "route":

route = True

A third module needs to call the function from the first module, but 
this fails now because the second module has overwritten (shadowed) 
the former function with a variable:


route = True
route()

Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'bool' object is not callable


You would need to find all those cases where one module overwrites 
variables or functions from other modules. And sometimes those cases 
will be difficult to spot. Python is not designed for what you are 
trying to do. Even if you get this done, it will not help you. You 
can't just throw everything into a single file and then magically 
optimize it. When you have this huge final module, what do you think 
you can do with it to be faster?


If you have performance problems with some module, you have several 
options to optimize it:


- Find a better algorithm.
- Rewrite performance-critical parts in Cython or even C and import 
the compiled module.

- Use a JIT compiler such as PyPy
--
https://mail.python.org/mailman/listinfo/python-list


why function throws an error?

2022-06-28 Thread נתי שטרן
def add_route(self, route):
#""" Add a route object, but do not change the :data:`Route.app`
#attribute."""
self.routes.append(route)
self.router.add(route.rule, route.method, route, name=route.name
)
#if DEBUG: route.prepare()
--

-- 
https://mail.python.org/mailman/listinfo/python-list