First time here? Check out the FAQ!

Alexander_Dragunkin's profile - activity

2020-05-18 09:18:07 -0500 marked best answer venv3.7 and typing

How to use typing in debugging?

Attempting to use * from typing import Generator * or * from typing import Dict * in the code results in an error.

Python 3.7.5 (tags/v3.7.5:5c02a39a0b, Oct 14 2019, 23:09:19) [MSC v.1916 32 bit (Intel)]
Type "help", "copyright", "credits" or "license" for more information.
>>> from typing import Generator
Traceback (most recent call last):
  Оболочка Python, prompt 1, строка 1
    # Used internally for debug sandbox under external interpreter
  Файл "c:\VENV37\Lib\site-packages\typing.py", строка 1357, из <module>    class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
  Файл "c:\VENV37\Lib\site-packages\typing.py", строка 1005, из __new__    self._abc_registry = extra._abc_registry
builtins.AttributeError: type object 'Callable' has no attribute '_abc_registry'

When you call the same code in the console, everything is fine.

(VENV37) AC..........OKS\ClassTasksPython
$ python
Python 3.7.5 (tags/v3.7.5:5c02a39a0b, Oct 14 2019, 23:09:19) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from typing import Generator
>>> def fib6(n: int) -> Generator[int, None, None]:
...     yield 0
...     if n > 0:
...         yield 1
...     last: int = 0
...     next: int = 1
...     for _ in range(1, n):
...         last, next = next, last + next
...         yield next
...
>>>
>>> if __name__ == '__main__':
...     for i in fib6(50):
...         print(i)
...
0
1
1
2
3
5
8
13
21
2020-05-18 09:18:01 -0500 received badge Self-Learner ( source )
2020-05-18 09:18:01 -0500 received badge Teacher ( source )
2020-05-18 07:16:35 -0500 received badge Enthusiast
2020-05-17 08:06:28 -0500 commented question venv3.7 and typing

Perhaps my comments can help someone. To configure debugging in a virtual environment, in the project properties tab e

2020-05-17 08:04:56 -0500 commented question venv3.7 and typing

Perhaps my comments can help someone. To configure debugging in a virtual environment, in the project properties tab e

2020-05-17 08:04:10 -0500 commented question venv3.7 and typing

Perhaps my comments can help someone. To configure debugging in a virtual environment, in the project properties tab e

2020-05-17 06:58:35 -0500 commented question venv3.7 and typing

I seem to understand what my mistake is. I removed from sys.path 'c:\VENV37', 'c:\VENV37\Lib', 'c:\VENV37\Lib\site-pa

2020-05-17 04:18:30 -0500 commented question venv3.7 and typing

import sys sys.path ['', 'c:\VENV37', 'c:\VENV37\Lib', '

2020-05-17 04:16:45 -0500 commented question venv3.7 and typing

import sys sys.path ['', 'c:\VENV37', 'c:\VENV37\Lib', '

2020-05-11 11:15:14 -0500 received badge Notable Question (source)
2020-05-05 18:11:27 -0500 received badge Popular Question (source)
2020-05-04 15:48:16 -0500 received badge Student (source)
2019-07-28 09:33:07 -0500 edited answer Graphical Profiler

A vital question and suddenly my experience will help. :) Will be required: Graphviz desirable (2.38) gprof2dot If th

2019-07-28 08:21:47 -0500 answered a question Graphical Profiler

A vital question and suddenly my experience will help. :) Will be required: Graphviz desirable (2.38) gprof2dot If th

2019-07-28 08:21:47 -0500 answered a question UnitTest & code coverage

A year later, I want to return to the topic pytest. Windows7 WingIde 7.1.0.2 (rev 664eebcf5216) platform win32 -- Pyt